Retired

Beam me up Statey using ReactJS (retired)

Description
Loading description...
React
Fundamentals
View
AllIssues3QuestionsSuggestionsShow Resolved
  • Please sign in or sign up to leave a comment.
  • evgeniy_pp Avatar

    Old school React class components! Well, that was fun... in a way. Firstly I rewrited everything to functions and hooks, but it turned out the test env does not know what React.useState is. Rewrited everything back again. But enjoyed it nevertheless.

  • Voile Avatar

    The kata's spec is very confusing: beaming people are supposed to be held in the inTransit properties. But then beaming 3 people should have them all beamed at once? Then what's the purpose of inTransit properties? They are supposed as a temporary storage, which means they shouldn't be tested (not to mention in reality it's not something that's actually needed).

  • Voile Avatar

    As mentioned below, poor kata design.

  • VKen Avatar

    This comment has been hidden.

  • hufftheweevil Avatar

    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)

  • Crunchwrap78 Avatar

    Hey the method you gave for defining functions is very unique. It needs more ways to pass like passing down functions, and arguments furthur to child components or returning with an arrow function because just doing it your way is not a good practice. If it were just passing down the function with it's arguments to a component within both planet and starship, I would have ok'd that.