-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add inline comments to code snippets in Main Concepts #967
Comments
I'd 💙 to take on this task @gaearon! I would update the tasks here of my current progress / plans and suggestions as I work on my PR before submitting it. |
That sounds great, thank you! |
@gaearon Here are my proposed additions for sections 2 - 8 that I'd like to begin implementing. I can expand on my outline too if needed. |
Can you send the first few changes as a PR so I can get a better sense of the exact way you want to do them? |
Absolutely! I'll work on that this coming up weekend- thanks! |
I have been attempting to run the docs locally and get the error: I did some research, and I removed |
Does it work if you switch to Node 8, if you're not already?
|
Thank you for getting back with me @alexkrolick ! |
Ok... you shouldn't have to install sharp or node-gyp manually, they should come in with the node_modules. Could be a yarn issue... try You can also try |
🎉 Thank you so much @alexkrolick! That absolutely did the trick, and I think it was a yarn issue as you suggested (wasn't on the latest version). I kept track of what I did below so if someone comes across this with a similar issue, it can help!
I'll get working on the PR and submit a WIP sample of my suggestions here soon. |
Adding inline comments to code examples would be helpful for beginners' comprehension in "Main Concepts" docs (along with the already provided explanations)!
Task
📚In current progress as of 7/8📚
WIP PR made #1048
Plan for Main Concepts
2. Introducing JSX
Embedding Expressions in JSX
//Hello, Harper Perez!
JSX is an Expression Too
Specifying Attributes with JSX
JSX Represents Objects
4. Components and Props
Functional and Class Components
(Class Components)
this
keyword in front of props.name.Rendering a Component
name="Sara"
(some naming conventions are required for Handling Events). When you write a JSX attribute inside of a component, think of it as adding key and value pairs to an object in JavaScript.// props: { name: "Sara"}
Composing Components
renders the following and displays:
Hello, Sara
Hello, Cahal
Hello, Edite
Extracting Components
In first code snippet, highlight Avatar block and comment
// In the next example, we'll be extracting this block of code into its own component
In the second code snippet, add comment with highlighted Avatar component with
\\ Avatar component will access props with user instead of author, explanation is below
5. State and Lifecycle
Converting a Function to a Class
Last 2 sentences
the this keyword inside of Clock points to its <Clock /> instance. In this case, that instance is inside of our ReactDOM.render() method.
8. Lists and Keys
Keys
todos
in an array of objects with an id and text propertytodos
example, display a variable fortodos
in an array of objects with no id and with text propertyThe text was updated successfully, but these errors were encountered: