React Native

React Native State Management

Context API, Redux Toolkit, Zustand, Recoil, state patterns, global state

24 mülakat soruları·
Mid-Level
1

Which React hook allows consuming a value from a Context?

Cevap

useContext is the dedicated hook for consuming values from a Context. It takes the Context object created with createContext as a parameter and returns the current value provided by the nearest Provider in the component tree. This is the modern and recommended way to access contextual data in functional components.

2

Which function should be used to create a Context in React?

Cevap

createContext is the function provided by React to create a new Context object. This function accepts an optional default value that will only be used when a component consumes the Context without having a corresponding parent Provider. The returned object contains two properties: Provider and Consumer.

3

What is the main drawback of Context API for global state management?

Cevap

Context API causes a re-render of all consumer components when the Context value changes, even if the component only uses part of that value. This behavior can cause significant performance issues in applications with many consumers or frequent global state updates.

4

What is the name of the Redux Toolkit function used to create a state slice?

5

Which state management library uses direct mutation syntax while remaining immutable under the hood?

+21 mülakat soruları

Bir sonraki mülakatın için React Native'de uzmanlaş

Tüm sorulara, flashcards'a, teknik testlere, code review alıştırmalarına ve mülakat simülatörlerine eriş.

Ücretsiz başla