What is React?
React is a JavaScript library to facilitate the creation of interactive, stateful and reusable UI components.
What is the virtual DOM?
It is an abstraction of the HTML DOM. It allows React to do its computations within the abstract DOM without the real DOM operations, often slow and browser-specific.
In most cases, what do you need to to transform HTML code into a static React component?
What is the directory node_modules/?
It contains all the dependencies that the package manager loads based on the dependencies list defined in the package.json file.
What is the directory public/?
What is the src/ directory?
The application code!
Where does the browser look for the initial instructions to render the React app?
public/index.html
Does the public/index.html file has to be blank? Why not?
No: you can add whatever static design frame and elements around the React element, and know that the app will appear inside that element when JavaScript executes.
What is src/index.js?
It is the file where React looks for initial instructions to build UI inside the root element defined in public/index.html.
What are the two different ways to import modules, assuming Webpack is used?
What are the arguments of the render() function within src/index.js?
Why can we use HTML and JSX expressions in a React app JavaScript file?
Because the JSX interpreter will compile the JSX tags and HTML tags into calls to React.createElement(). Incidently, the React module has to be imported even if not seemingly used.
What is the component < App/ >?
What are all components expected to do?
All components are expected to define a function called render() that returns some DOM elements.
Why are curly brackets special inside JSX tags?
They indicate that the code inside the curly brackets is JavaScript. It can be used to print the evaluated value of a JavaScript expression in the generated markup.
What cannot be put inside curly brackets inside JSX tags?
Statements CANNOT be within these curly brackets, but any JavaScript expression can be.
How to run a React app in development?
$ npm start
What does $ npm test does?
It launches a test runner (i.e. Jest) watching changes to the app and trying to run related tests.
What does $ npm run build does?
It packages the app for a production deployment, at /build/static/js/.
How does React handles non-JavaScript assets?
Webpack loaders (which create-react-app is using behind the scenes to build the app) let you load them directly in Javascript through the module system if files are included in the ‘src’ directory.
What is a SPA (Single Page Application)?
A SPA website usually loads once, then rewrites sections of a page rather than loading entire new pages from a server.
What are React components?
What are Web components?
What is JSX?