React is great for breaking Javascript down into small, manageable chunks (making it compartmentalized)
There are three things in the react head that are required to get it to work, React, React-DOM, and Babel (or another compiler)
-ReactDOM.render(<App />, document.getElementById('root')) this line render s the App into the DOM
-Javascript expressions must go within {} if being used within HTML
const [reader, writer] = useState(defaultState) is an example of using the useState function to set what the initial state, or value, of a variable is.
-Parcel will translate all the react code we write into useable HTML/JS that the browser is able to understand
In React, data is passed from parent to child using Props, they are formatted like so const [clue, setClue] = React.useState("");
Instead of using a formally expressed .eventListener like in regular JS, in react events are listened for by using code similar to the following <div onClick={() => console.log('anonymous func')}>
TODAY I LEARNED
React is great for breaking Javascript down into small, manageable chunks (making it compartmentalized)
There are three things in the react head that are required to get it to work, React, React-DOM, and Babel (or another compiler)
-
ReactDOM.render(<App />, document.getElementById('root'))
this line render s the App into the DOM-Javascript expressions must go within {} if being used within HTML
const [reader, writer] = useState(defaultState)
is an example of using the useState function to set what the initial state, or value, of a variable is.-Parcel will translate all the react code we write into useable HTML/JS that the browser is able to understand
In React, data is passed from parent to child using Props, they are formatted like so
const [clue, setClue] = React.useState("");
Instead of using a formally expressed .eventListener like in regular JS, in react events are listened for by using code similar to the following
<div onClick={() => console.log('anonymous func')}>