Adding inline comments to code examples would be helpful for beginners' comprehension in "Main Concepts" docs (along with the already provided explanations)!
馃摎In current progress as of 7/8馃摎
WIP PR made #1048
Embedding Expressions in JSX
//Hello, Harper Perez! JSX is an Expression Too
Specifying Attributes with JSX
JSX Represents Objects
Functional and 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
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
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. Keys
todos in an array of objects with an id and text propertytodos example, display a variable for todos in an array of objects with no id and with text propertyI'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: Cannot find module '../build/Release/sharp.node' when I run yarn dev.
I did some research, and I removed .cache, installed node-gyp and the necessary window build tools. That helped me not receive any dependency errors when I ran yarn. I tried also adding sharp, and removed and reinstalled node_modules. Still getting that pesky error!
Does it work if you switch to Node 8, if you're not already?
Thank you for getting back with me @alexkrolick !
Currently using 8.10.0
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 yarn cache clean and make sure you are on the latest version.
You can also try yarn remove gatsby-plugin-sharp gatsby-transform-sharp then add them back after everything else installs
:tada: 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!
rimraf node_modules (rimraf is a utility for nodejs)
yarn cache clean
yarn upgrade
I'll get working on the PR and submit a WIP sample of my suggestions here soon.
Most helpful comment
That sounds great, thank you!