Files
30-seconds-of-code/snippet-template.md
2019-09-11 09:13:29 +03:00

25 lines
506 B
Markdown

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