As in my previous post, I think the React tutorial is excellent. These comments are in no way criticism, but merely my suggestions to perhaps (maybe) improving it somewhat (but maybe not).
==================
For lesson 4, I just have the simple comment. In the notes we have:“There is a div with id=‘challenge-node’ available for you to use. Make sure you don’t change the JSX constant.” Why not show this div explicitly somewhere? Make it less mysterious.
================
Lesson 7 is perhaps more substantive. Is this line
<DemoComponent customClass = 'wrapperClass' />
equivalent (at least logically) to javascript-ish code:
var props = {"customClass":"wrapperClass"};
var ddiv = DemoComponent(props);
so that ddiv looks like
<div class(className?)="wrapperClass">
(in some storage syntax)? If so, it might be useful to add that such is the case.
My test response was originally
const MyComponent = function(props) {
return ( <div>{props.someText}</div>);
}
<MyComponent someText = "now is the time"/>
Based on your example, this might be correct (Is it?). However, it does not pass the test. The solution code
const MyComponent = function() {
return (<div>Demo Solution</div>);
}
basically ignores the introductory example, so what is the point of introducing “props” in the first place?
IN ADDITION, in light of lesson 9 (composition), it wold be very useful to say something like: “This notation <…> actually returns a component which you can use in place of raw HTML. In this example, we are not using the return value, but in lesson 9 you will use it.”
Finally, a couple of quick questions.
Is the use of “const” mandatory, or could one use “var” or even let?
Does one need parens after “return”?