React 18
React 18
- useRef returns an immutable ref object whose current property is initialized to the passed
argument
- mutating the .current property causes a re render
you are developing a react application. Which of the following are true about the rules we must
always follow?
How to update state (name field) in a nested object in React with hooks?
You need to migrate an old React version to the latest React hooks. Which of the following
statements about the useState hook are correct?
- Posiblemente la B
- All cases
You are using React v.16.8++ to develop a web application. Which of the following methods are
served by the useEffect hook in react hooks?
- componentDidMount
- componentWillUnmount
- componentDidUpdate
you want to get the mouse position when the mouse moves in your react application. How can
you do this in react 16.8++?
You are ReactJS developer at Turing in which of the following cases would you use Hooks instead
of classes?
To perform side effect after state change. Which hook should you do in react v.16.8++?
- useEffect
you are developing a react application with the latest version. You need to implement a custom
hook to calculate window size. How can you do this?
You are using react v16.8++ to develop a website. You want to create a customhook. Which of the
following is an INCORRECT statement about the custom hook?
What are the differences in using hooks and class components with respect to state management?
You are using the latest ReactJS to develop a web application. You want to prevent re render to
improve performance. How can you do this?
- React.memo
Which of the following are reasons that you might use React hooks?
- Select all
You are a ReactJS developer at Turing. You need to migrate an old React system to use React
Hooks. Which of the following statements are correct if we compare performance between classes
and hooks?
- Hooks result in smaller component trees because it avoids the nesting present in HOCs
and render props resulting in less work for React to do
- Hooks avoid a lot of the overhead that is present with classes susch as the creation of
instances and binding of events.
- A and B , probably wrong Can only choose one answer Chose All
Consider the following source of code and suggest a solution to its problem
Which of the following statements about useReducer hook is correct?
You are a reactjs developer at turing. You need to improve the performance of a react system that
is using the latest react version. How would you do this
You are a reactjs developer at turing. You need to get the previous props or state. How would you
do this?
What are the difference between useEffect and componentDidMount? I chose all