react-jsx Flashcards
1
Q
What is JSX?
A
JSX is a syntax extension to JavaScript that is used with React to describe what the UI should look like.
2
Q
Why must the React object be imported when authoring JSX in a module?
A
Because without importing the React object, the JSX code cannot be used in React to create elements.
or
Because if you give JSX to Babel, the JSX is just the sugar for the React.createElement calls.
3
Q
How can you make Webpack and Babel work together to convert JSX into valid JavaScript?
A
By including the plugin “@babel/plugin-transform-react-jsx” in the webpack.config.js file.