Setting up the environment Flashcards
What is the easiest way to create a react environment?
using npx create-react-app
What is necessary to have to run create-react-app?
Is is necessary nodejs
What npm stands for?
Node package manager
What does npx stands for?
Node package execute
What is npm eject?
It will stop hiding what it’s got installed under the hood by create-react-app and instead eject those things into your project’s package.json for everyone to see
How to create a react environment without create-react-app? Where to find the full list and details?
create a new dir and then do a npm init -y, after that install depenencies (e.g: express, react and react-dom, webpack, webpack-cli and babel , nodemon, ESLint )
Full list and details can be found at: jscomplete.com/reactful
Will “npm install” command install the package and its dependencies automatically?
Yes… all dependencies’ dependencies will automatically installer as well..
What is webpack? Why does it exist? Will browsers support it automatically?
webpack bundles all the packages together in a single bundle file to be able to send to the browser. It exists because browser do not support it but seems that will support at some point.
What is babel? What does it do?
Babel is another module necessary for react. It translates JSX to React-API calls. Also guarantee backward compatibility of new JS features with older browsers.
What is nodemon?
Allows node to refresh automatically in case of changes.
What is ESLint?
Checks if code is working and also checks for best practices including styling.
What is the difference between dependencies and devDependencies?
dependencies are required by the production server and development environment and devDependencies is only necessary for development environment and CI/CD - won’t go to production;
What is prettier?
Make the react file auto indented.
What is the common extension of a file that configures a dependency?
.config.js
What is the reactful package?
Similar to create-react-app but with the bare minimum feature to make react work and also it ejects the modules by default.
How to make vs code format on save?
There’s a setting called Format On Save that executed prettier automatically.
What is the scss extension?
It is the sass css file…. normal css also fits here.
How to separate components into separated files?
By creating the files and exporting the component itself (object). After that is necessary to import it in the other files.
What is the syntax to export the component (object)? And what is the syntax to import it again?
export default PlayNumber;
Import PlayNumber from “./PlayNumber”
Where to find more games to build with react?
jscomplete.com/react-beyond-basics
What is recommended to use when using React with APIs? Is there a course on Pluralsight?
To use GraphQL. Same has a course on pluralsight.
What are the common webpack properties that need to be declared?
Output, devserver, plugins, module and loaders.