I've recently been using react.js to develop web interfaces for my projects. I never understood what is the difference between creating a component with a function and creating a component with a class. what is the difference?
function:
const Component = () =>{
return(
<div>
</div>
)
}
export default component
or class:
class Component extends React.Component {
render() {
<div>
</div>
}
}
export default Component