Skip to content

Instantly share code, notes, and snippets.

@Blazing-Mike
Created June 6, 2022 09:58
Show Gist options
  • Save Blazing-Mike/27f8d803aa0edb4195373dac317b57f3 to your computer and use it in GitHub Desktop.
Save Blazing-Mike/27f8d803aa0edb4195373dac317b57f3 to your computer and use it in GitHub Desktop.
destructuring in react class component
class Greeter extends React.Component {
render() {
const {first, last} = this.props;
return <h1>Hello, {first} {last}</h1>;
}
}
ReactDOM.createRoot(document.getElementById("root")).render(
<Greeter first="Srini" last="Kata" />
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment