import React, { Component } from 'react'; class MyButton extends Component { handleClick = () => { console.log('Button clicked!') } render() { return ( ); } }
import React, { Component } from 'react'; import { render } from 'react-dom'; class App extends Component { render() { return (This example shows how the custom button component can be used inside of a larger application. The `render` function is called to display the entire `App` component, which includes the `MyButton` component. Package Library: React (https://reactjs.org/)); } } render(Hello, World!
, document.getElementById('app'));