Q22 Which of the following are true w.r.t context API a) Context API is used to share the date between multiple componen

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Q22 Which of the following are true w.r.t context API a) Context API is used to share the date between multiple componen

Post by answerhappygod »

Q22 Which Of The Following Are True W R T Context Api A Context Api Is Used To Share The Date Between Multiple Componen 1
Q22 Which Of The Following Are True W R T Context Api A Context Api Is Used To Share The Date Between Multiple Componen 1 (117.8 KiB) Viewed 59 times
Context API
Q22 Which of the following are true w.r.t context API a) Context API is used to share the date between multiple components without the need of drilling the props down b) A context can be consumed only by using a consumer c) A context can be created using useContext hook d) We can create only one context within an application Q23 Which of the following is the correct way to create context and pass the props through Context Provider a. export const LanguageContext = createContext() <Language Context.Provider value={{lang: 'en'}}> {this.props.children] </LanguageContext.Provider> b. export const LanguageContext = createContext({lang:'fr'}) <LanguageContext.Provider value={{lang:'en'}}> {this.props.children] </LanguageContext.Provider> c. export const LanguageContext = createContext({lang:'fr'}) <LanguageContext.Provider prop={lang: 'en'}> {this.props.children] </LanguageContext.Provider> d. export const Language Context = createContext() <LanguageContext.Provider prop={{lang:'en'}}> {this.props.children] </LanguageContext.Provider> 12/14 a) Both a and b b) Only a c) Only b d) Both b and d
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply