- Document demonstrates how to use GitHub's markdown syntax to make a collapsible codeblock.
* Concept 1
* Concept 2
<details><summary>Code Example</summary><p>
```JSX
const someComponent = (props) => {
const [newAttribute, setAttr] = useState(props.attr);
const clickHandler = () => { setAttr('This is the new value.'); };
return (
<div>
{props.attr}
<button onClick={clickHandler}>Change Attribute</button>
</div>
);
}
```
</p></details>
-
Concept 1
-
Concept 2
Code Example
const someComponent = (props) => { const [newAttribute, setAttr] = useState(props.attr); const clickHandler = () => { setAttr('This is the new value.'); }; return ( <div> {props.attr} <button onClick={clickHandler}>Change Attribute</button> </div> ); }