NEW
Font size
S
M
L
XL
WorksheetsReact and Hooks
Total questions: 10
Worksheet time: 6mins
Name
Class
Date
1.
In which version of React did Hooks add?
a)
15.6
b)
16
c)
16.8
d)
18.1
2.
What are Hooks?
a)
Class components
b)
Function components
c)
Javascript functions
d)
Lifecycle methods
3.
Which is not an in-build hook?
a)
useEffect
b)
useFetch
c)
useState
d)
useRef
4.
In which phase of lifecycles do the states initialise?
a)
Updating
b)
Mounting
c)
Unmounting
d)
Both 1 and 2
5.
Which won't cause re-render in the component?
a)
Changes in state
b)
Changes in props
c)
Changes in .current of useRef
d)
Changes in dependency array of useEffect
6.
Which of the following is(are) correct methods to create reactJS component
a)
class MyComponent extends React.Component { render() { return ( <div>Demo</div> ) } }
b)
const MyComponent = () => { return ( <div>Demo</div> ) }
c)
function MyComponent = () => { return ( <div>Demo</div> ) }
d)
Only a
e)
a, b and c
7.
We can integrate reactJS in any of the existing web app
a)
true
b)
false
8.
ReactJS does not need HTML or any of the HTML preprocessor to make UI elements
a)
true
b)
false
9.
Which one is valid for inline styling in reactjs
a)
<div style={{ backgroundColor: 'red', fontSize: '16px' }} > Hello World! </div>
b)
<div style={{ background-color: 'red', font-size: '16px' }} > Hello World! </div>
c)
<div style="background-color: red; font-size: 16px" > Hello World! </div>
d)
all of the above
10.
Props can be modified in child component directly like state
a)
true
b)
false
Reset
