React Flashcards
What are props in React?
props are arguments that are passed into react components
How do you pass props to a component?
…
How do you write JavaScript expressions in JSX?
by using {}
How can you make Webpack and Babel work together to convert JSX into valid JavaScript?
By adding the @babel/plugin-transform-react-jsx to babel loader.
Why must the React object be imported when authoring JSX in a module?
because JSX is an extension of React. JSX compiles into react. Specifically React.createElement();
What is JSX?
JSX is a syntax extension for describing what a UI should look like in React.
How can you make Babel and Webpack work together?
By installing the babel loader and add it as a plugin to Webpack in a webpack config file.
What is a Webpack loader?
Loaders are transformations that are applied to the source code of a module.
What is a Plug-in?
A software component that adds a specific feature to an already existing program
What is Babel?
Babel is a toolchain that is mainly used for converting ECMAScript 2015+ code into a backwards compatible version of JavaScript
How do you mount a React element to the DOM?
By calling render method the the ReactDom object and passing it two arguments, the elements and the root DOM node.
What is a React element?
A React element is a plain object that the ReactDOM translates into a DOM object
What is React?
React is a JavaScript framework for building user interfaces
What kind of modules can Webpack support?
ECMAScript, CommonJS, and AMD modules
How do you execute Webpack with npm run?
by running the npm run build command. build is an npm script that bundles the modules into a main.js file.