What are two types of components in ReactJS?
What are two types of components in ReactJS?
In ReactJS, there are two primary types of components:
function Welcome(props) {
return <h1>Hello, {props.name}</h1>;
}
React.Component
. Class components can manage their own state and contain lifecycle methods, making them stateful. They also have a render
method that returns JSX. An example of a class component is:junior
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào