Files
30-seconds-of-code/snippets/react/template.md
2023-05-07 16:07:29 +03:00

31 lines
599 B
Markdown

---
title: Component Name
type: snippet
language: react
tags: [components,state,effect]
cover: image
dateModified: 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 />
);
```