king77
1
front-end-libraries/react/write-a-react-component-from-scratch/
note:Below is my answer to the exercise but I am some how still getting it wrong…
// change code below this line
class MyComponent extends React.render{
constructor(props){
super(props);
}
render() {
return(
<div>
<h1> My First React Component!</h1>
</div>
);
ReactDOM.render(<MyComponent />,document.getElementById('challenge-node'))
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I haven’t written a class component in a while but is extends react.render correct? Or should it extend react.classcomponent? I’m honestly not sure
king77
3
Thanks for the response .let me go through it completely.
king77
4
It should actually read React.Component at the end.Like so; class MyComponent extends React.Component.
Thanks for opening my mind.