extends component react native code example
Example 1: create react component class
class MyComponent extends React.Component{
constructor(props){
super(props);
};
render(){
return(
My First React Component!
);
}
};
Example 2: create-react-app class component
npx create-react-app my-app --scripts-version [email protected]
Example 3: react native function
class Foo extends Component {
handleClick() {
console.log('Click happened');
}
render() {
return ;
}
}