react-class-components Flashcards
1
Q
How do you create a “class” component in React?
A
class keyword, ClassName, extends keyword, React.Component, curly braces, inside curly braces is the root prototype method that returns a react element in it’s codeblock
react components always need to return a react element
2
Q
How do you access props in a class component?
A
in a class component, props is a property of this whereas in a function it is an argument