7 kyu
Creating Elements with React
1,000 of 1,002dnolan
Loading description...
React
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
If I use a tag directly within the function (even when Ive used it properly) it says SyntaxError: Unexpected token < at createScript (vm.js:80:10)
I tried to run one of the other successful solutions posted which also had the tag used and got the same response. Any idea why?
Yup, same issue here.
For someone new to React this is extremely vague and confusing. Especially around createElement and how it is meant to be implemented here. Literally NONE of the solutions are even close to this starting code. In order to get this working you need to add to the params of the functions (which if you don't know React you would have 0 clue).
lol.
What a kata....
Make the createElement => use React.createElement
This is a poorly worded kata, it should have stated use the React.createElement method.
I'm having some troubles with the createElement. The 'should be able to take in a properties object' fails. Expected: 'identifier', instead got: null and Expected: 'value', instead got: undefined. Can someone pls help me with that one?
I seem to have misunderstood the question and never used
React.createElement
method. Even though I read "wrapper method", somehow my brain translates it into "reimplementReact.createElement
"I completed the kata using functional-component declaration, different from many of the solutions.
Perhaps a test case that checks for class-component properties that functional components does not have, will help right my tunnel vision during submission.
Not a JavaScript kata.
Not an issue.
I'm having issues with one of the server's tests: "should render the list properly". What is the list passed as param in that case? Thanks!
Hey there! It's similar to the example given in the kata description with
['apples', 'oranges', 'bananas']
, except with peoples' names (ie.['Ray', 'James']
) instead of fruit. Their outputs should be formatted the same way =)I think I will set this one aside for now. I am at work (none coding job) and I want to be able to take my time with this one.
I kind of wished that the examples would include one that makes use of the "props" argument. Oh well.
Not so easy, particularly if you have little background in this stuff (the doc didn't help at all in my case; on the contrary...), but glad I did and learned something new: thanks :)
cool I thought we had to use the javascript only version of React but from the other solutions it looks like node automatically interperets JSX with
require('react');
Good to see React here, but shouldn't that be separate language from JS? Thanks for that Kata, I see it's time to learn something new!
For a framework that many people won't be familiar with, Facebook's documentation is highly technical and skips some basic assumptions. I had to guess several times what syntax it was looking for.
Kudos to them in that my guesses were right every time, so it's reasonably intuitive, but there should really be some complete examples somewhere.
UndorderedList -> "UnorderedList"
Oof! I must have missed that one. Thanks!
Missing example test cases.
Thank you for the feedback! Added some helpful example test cases =)
I have a solution working in the console (of a browser), but when I click "Run tests" inside codewars all I get is a an helpful "Test didn't pass: Unknown error". Is the server running tests down at the moment?
There aren't any example test cases. Have you tried to submit the code instead?
Hmm yeah it's possible you were seeing an error because there were no example test cases like bkaes suggested.
I've added some example test cases, so give it another go and let us know if you run into any more problems =)
Right, I didn't pay attention at the test cases (or lack of test cases actually). I've submitted by solution and it worked ;)
This is the best Kata I did encounter nowadays! It finally forced me to look at React, wich I was avoiding for too long I guess. Thank you!
Thank you! This was my first time looking at React myself to be honest. I'm hoping that other developers will be able to come up with even better React Katas! =)