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

29 lines
564 B
Markdown

---
title: Component Name
tags: components,state,effect
cover: image
firstSeen: 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.
```jsx
const ComponentName = props => {
const [state, setState] = React.useState(null);
React.useEffect(() => {
setState(0);
});
return <div>{props}</div>;
}
```
```jsx
ReactDOM.createRoot(document.getElementById('root')).render(
<ComponentName />
);
```