Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

You are using react v.16.8++ to develop a web application.

Which of the following statements


about the useState hook are correct? Only choose one I chose During subsequente

- Combining the function updater form with object spread syntax


- During subsequent re renders, the first value returned by useState will always be the most
recent state after applying updates.

Which of the following is incorrect in useRef?

- 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?

- Only call hooks from react function components


- Never call hooks from inside a loop, condition or nested
- Never call a hook from a regular function

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

Which use cases should you use the useRef?

- 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++?

- A and B you can only choose one I chose A

You are ReactJS developer at Turing in which of the following cases would you use Hooks instead
of classes?

- All of the above cases

Consider the following source code:

What is the difference between useEffect and useLayoutEffect?

- Sin respuesta I put all

Consider the following source code:

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?

- All of the above

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?

- Hooks can be used inside classes

What are the differences in using hooks and class components with respect to state management?

- All of the above

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?

Which methods do not have the hook equivalents in react 16.8++?


Which of the following statements about useLayoutEffect in React Hooks is correct?

- 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.

What are the differences between React.memo and useMemo in React?

- A and B , probably wrong Can only choose one answer Chose All

Consider the below snippet code

Consider the following source of code and suggest a solution to its problem
Which of the following statements about useReducer hook is correct?

- All of the above

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

Consider the below snippet code


You are using react hooks to develop a turing system. How can you fetch data with it?

- Using useEffect hook to fetch data

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

You might also like