how to call a component from a function and return value from that function in react js code example
Example 1: react functional components
const component = () => {
console.log("This is a functional Component");
}
Example 2: react native function
class Foo extends Component {
handleClick() {
console.log('Click happened');
}
render() {
return ;
}
}