This lesson will teach you the basics of setting properties in your React components.
You could do something like this:
Or you could create a custom validator: https://egghead.io/lessons/react-custom-proptype-validation
The HTML code for this lesson does not have a tag to include JSXTransformer.js. That was included in the preceding lessons, and I had to add it to get this lesson to work on my machine. Otherwise I just get a blank screen in the browser.
However, I see that on jsbin.com your code for this lesson is working just fine without including JSXTransformer.js. Why do I need to include JSXTransformer.js but you don't?
I cant see any warning when a field is required and i have the same code as the video, why?
I have the same issue. Having looked on StackOverflow, the reason seems to be that only the development version of React shows the warnings for
isRequired violations. The JSbin for this tutorial uses the production version-
react.min.js, instead of the development version-
So, switch this line:
For this line:
I was pretty confused following along with this lesson having started with the first tutorial video in this series. That video has you set up a React environment and in the main.js file of that app is the line:
That line is apparently at odds with the ReactDOM.render line in the tutorial above. This caused my webpage to show nothing at all.
Unless I missed something in the tutorials after the first one, maybe you guys should make it more clear what to do. But again, I may have missed that.