What is the name of the base component that all components in react extend?
React.Component
what hook is used in function components to replace life cycle methods?
useEffect
name 3 examples of hooks
useEffect, useState, useForm, useMemo, etc.
What is the importance of automated testing?
What method is used in class components to render data to the DOM?
render()
which class-based lifecycle method should axios calls mainly be used inside?
componentDidMount
What is stateful logic?
logic built into a component that deals with state
name three common types of testing
integration, end to end, unit
What method must we call in react components in order to have access to special properties in the 'this' keyword?
super()
What are the three react lifecycle phases?
Mounting, Updating, Unmounting
What are custom hooks and why are they important?
custom hooks are blocks of stateful logic that are built by the developer. they are used to keep code reusable and dry
What is the library you used for testing today
jest/react testing library
True or False: state is persistent as long as the component is on the screen
true
True or False: the render() method is called only during the Mounting phase
False. it is also called during the updating phase
every item in localStorage must be what type of data?
string
Explain the 'Arrange, Act, and Assert' framework
First, we “arrange” our test by setting up our code such that it can be tested. Then, we “act” - calling a method or function that returns a result of interest to our test. Finally, with that return we “assert” if our expected return matched the actual return.
In React, data is linked in a 'Uni-Directional' fashion. What does this mean?
Data is linked from top to bottom, Meaning that whatever is set on the state of one Component can be shared amongst all components by passing it down as props.
what is the name of the method called in the unmounting phase?
componentWillUnmount
What is the difference between local Storage and session Storage?
local storage persists until the data is manually cleared while session storage persists until the window or tab is closed
besides RTL/jest, name 3 other testing libraries/ frameworks
Mocha, Cypress, Jasmine, Karma, Puppeteer