• Sign Up
  • Kata
  • Kumite
  • Blog
  • Forum
  • Wiki
  • Leaders
  • Log In
  • Sign Up
Name:Richard Kotze
Clan:Unknown
Skills:javascript, elixir, c#
Member Since:Mar 2017
Last Seen:Oct 2020
Profiles:
Following:31
Followers:32
Allies:23
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (78)
  • Replies
  • Authored
  • Needs Resolution
    • barakplasma
    • commented on "Ranking Poker Hands" javascript solution

    the most legible solution I've reviewed so far; great work!

    • anton.a.minin
    • created a suggestion for "Truncate paragraph using higher-order component in React JS" kata

    Hi, @richkotze!

    Thanks for a nice kata.

    But, what if typeof childten isn't a string?

      it('should not shorten text unless typeof children is string', () => {
        const result = shallow(<ShortParagraph><b>{text}</b></ShortParagraph>);
        expect(result.children().text()).toEqual(text);
      });
    
    • Bijayadhs
    • commented on "The maximum and minimum difference -- Simple version" javascript solution

    This comment is hidden because it contains spoiler information about the solution

    • mikhama
    • commented on "Truncate paragraph using higher-order component in React JS" kata

    Thank you very much!

    • kazk
    • commented on "Truncate paragraph using higher-order component in React JS" kata

    Codewars currently doesn't allow authors to specify a test framework, but the code runner service does support other test frameworks including Jest for JS/TS. When this kata and other React kata had to be updated from Node 6.x, I had to specify the React environment available in Node 10.x/12.x using a hack because the default environment no longer includes React. The new React environment uses Jest.

    @mikhama

    Until Codewars supports the configuration in the kata editor, you need to use some hack using a special comment. To create a kata with React, you need to set the language version to Node 12.x and add the following to Preloaded:

    // HACK The following special comment allows React with Jest.
    // This is a temporary hack until Codewars supports test framework choices.
    // @config: env-set node12_react
    

    This will tell the code runner to use the React environment instead.

    The tests should look something like the following:

    import React from "react";
    import Adapter from "enzyme-adapter-react-16";
    import Enzyme, { shallow } from "enzyme";
    Enzyme.configure({ adapter: new Adapter() });
    
    import FooComponent, { foo } from "./solution";
    
    // Then write tests
    
    • richkotze
    • resolved a question on "Truncate paragraph using higher-order component in React JS" kata

    You need to import react in both solution and test case code views.

    Don't think Jest is available in codewars.

    See the package.json for available testing frameworks: https://github.com/codewars/codewars-runner-cli/blob/master/package.json

    • mikhama
    • created a question for "Truncate paragraph using higher-order component in React JS" kata

    Hello @richkotze,

    Could you help me with adding React task to Codewars?

    How to add React and Jest to environment?
    I've tried to do that, but Codewars complaing on "import React".

    • AliciaaaRo
    • commented on "Easter egg list in ReactJS" kata

    This comment is hidden because it contains spoiler information about the solution

    • SaulReznik
    • commented on "Easter egg list in ReactJS" kata

    In any case it gives the same error, even if the file is empty ----> "Invariant Violation: Minified React error #105;"

    • VKen
    • commented on "Beam me up Statey using ReactJS" kata

    This comment is hidden because it contains spoiler information about the solution

    • hufftheweevil
    • commented on "Beam me up Statey using ReactJS" kata

    .

    • richkotze
    • commented on "Beam me up Statey using ReactJS" kata

    This comment is hidden because it contains spoiler information about the solution

    • hufftheweevil
    • commented on "Beam me up Statey using ReactJS" kata

    Love the idea of doing some React on here. We need more of it.

    However, I'm not sure this kata is a good representation of how "Lifting Up State" should work. The state (the list of inhabitents in each location, in this case) should be stored in "their closest common ancestor", which would be Universe. The Universe should pass two props (a transport handler and a list) down to Planet and Starship. That setup would eliminate the need for componentWillReceiveProps (which is now considered unsafe)

    • TudorTacal
    • commented on "PC upgrade specs using HOC in ReactJS" kata

    Brilliant kata to get someone started with HOC's.

    It might be useful to write a test against hard coding 110 straight into the HOC instead of reading the value from the second parameter passed to withPriceModel.

    I enjoyed the atmosphere from the Code Dojo as well. Make sure you ping me again when you organise the next one ;)

    • shovelend
    • resolved an issue on "Unshackle the Beast (uncontrolled components in ReactJS)" kata

    We're validating the input value now.

  • Loading more items...
  • © 2021 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Contact
  • powered by

Confirm

  • Cancel
  • Confirm