questions
Q3 Predict the output based on the given code snippet when user enters url http://ocalhost3000/appl. Assume that all the required imports and exports are added. <BrowserRouter> <Switch> <Redirect from="/appl' to="/app2' exact/> <Route path="/appl' component={Appl} /> <Route path="/app2' component={App2} /> </Switch> </BrowserRouter> a) Appl will be rendered properly b) App2 will be rendered correctly c) A blank page will be rendered d) Both Appl and App2 will be rendered Q4 Select the correct statements regarding Router from the options listed below 1. For Route component, path can be passed as a single string or arrays of strings 2. For a matching location, Route can use component prop to render the corresponding component 3. For a matching location, component can be written as child of Route component a) 2 and 3 are correct b) 1 and 2 are correct c) All are correct d) Only 3 is correct Q5 Anil and John were discussing about the implementation of security in their React application. They need to check whether the user is authenticated whenever a page is selected. Anil: In order to check every time user selects a page hoc can be used John: For checking every time, render props could be used Select the correct statement: a) Anil is correct and John is wrong b) Anil is wrong and John is correct c) Both are wrong d) Both are correct
React Js Q3 Predict the output based on the given code snippet when user enters url http://ocalhost3000/appl. Assume that all the
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am