React (Basic) Flashcards
To add a state variable, import useS_._. from React at the top of the file
To add a state variable, import useState from React at the top of the file
The idea of JSX is quite similar to many t____ing languages
The idea of JSX is quite similar to many templating languages
effect hooks are precisely the right tool to use when f____ing data from a server.
effect hooks are precisely the right tool to use when fetching data from a server.
The useState function (and useEffect) must not be called from inside of a L____, a c________ expression, or any place that is not a function defining a com______
The useState function (and useEffect) must not be called from inside of a loop, a conditional expression, or any place that is not a function defining a component
The axios ‘get’ method returns a p_____
The axios get method returns a promise
a call to a state-updating function triggers the re-r________-ing of the component
a call to a state-updating function triggers the re-rendering of the component
The second parameter of useEffect is used to specify how o____ the effect is run. If the second parameter is an empty array [], then the effect is only run along with the f____ render of the component.
The second parameter of useEffect is used to specify how often the effect is run. If the second parameter is an empty array [], then the effect is only run along with the first render of the component.
All events propagate in React except onS_._.., which only works on the JSX tag you attach it to.
All events propagate in React except onScroll, which only works on the JSX tag you attach it to.
The browser gets the JavaScript from the React d__ s______, which is the application that runs after running the command npm run dev
The browser gets the JavaScript from the React dev server, which is the application that runs after running the command npm run dev
Functions that create actions are called a____ c_____s.
Functions that create actions are called action creators.
axios is installed as a runtime dependency of the application because the execution of the program requires the existence of the l_____
axios is installed as a runtime dependency of the application because the execution of the program requires the existence of the library
React treats a component defined inside of another component as a n____ component in every render
React treats a component defined inside of another component as a new component in every render
the content of a React component (usually) needs to contain one r.._ element.
the content of a React component (usually) needs to contain one root element.
Effects let a component connect to and synchronize with ex____ systems
Effects let a component connect to and synchronize with external systems
_ _ _ is a syntax extension for JavaScript that lets you write HTML-like markup inside a JavaScript file.
JSX is a syntax extension for JavaScript that lets you write HTML-like markup inside a JavaScript file.
One best practice in React is to L____ the s____ up in the component hierarchy.
One best practice in React is to lift the state up in the component hierarchy.
In React, it’s conventional to use ..Something names for props which take functions which handle events and h____Something for the actual function definitions which handle those events.”
In React, it’s conventional to use onSomething names for props which take functions which handle events and handleSomething for the actual function definitions which handle those events.”
rendering completely different React elements depending on the state of the application is called c________ rendering
rendering completely different React elements depending on the state of the application is called conditional rendering
Under the hood, JSX returned by React components is c________ed into JavaScript.
Under the hood, JSX returned by React components is compiled into JavaScript.
Local variables don’t persist between r________s.
Local variables don’t persist between renders
An event handler is supposed to be either a f________ or a f________ reference
An event handler is supposed to be either a function or a function reference
useEffect takes _ parameters
useEffect takes 2 parameters
When a software developer uses React, they rarely or never directly manipulate the D._
When a software developer uses React, they rarely or never directly manipulate the DOM
I_._x as a key is an anti-pattern
Index as a key is an anti-pattern