Skip to content

Instantly share code, notes, and snippets.

@justusromijn
Last active June 11, 2019 19:54
Show Gist options
  • Save justusromijn/51af65b430b18b3edf074ec1a3d2eceb to your computer and use it in GitHub Desktop.
Save justusromijn/51af65b430b18b3edf074ec1a3d2eceb to your computer and use it in GitHub Desktop.
Smart React Component
import * as React, { useState } from 'react';
import { Button } from './button';
export const ButtonBash = () => {
let [count, setCount] = useState(0);
return (
<>
<p>Bashes: {count}</p>
<Button onClick={setCount(count + 1)} label='foo' />
</>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment