Files
30-seconds-of-code/snippet-template.md
Angelos Chalaris f39deb9522 Update to React 18
2023-04-14 20:32:31 +03:00

564 B

title, tags, cover, firstSeen
title tags cover firstSeen
Component Name components,state,effect image 2021-06-13T05:00:00-04:00

Explain briefly what the snippet does.

  • Explain briefly how the snippet works.
  • Use bullet points for your snippet's explanation.
  • Try to explain everything briefly but clearly.
const ComponentName = props => {
  const [state, setState] = React.useState(null);
  React.useEffect(() => {
    setState(0);
  });
  return <div>{props}</div>;
}
ReactDOM.createRoot(document.getElementById('root')).render(
  <ComponentName />
);