Skip to content

Instantly share code, notes, and snippets.

@treyhuffine
Last active March 5, 2019 20:01
Show Gist options
  • Save treyhuffine/7a5cd0992a46e62f262fcc4638382ae3 to your computer and use it in GitHub Desktop.
Save treyhuffine/7a5cd0992a46e62f262fcc4638382ae3 to your computer and use it in GitHub Desktop.
import * as React from 'react';
const MyComponent: React.FC = () => {
const [count, setCount] = React.useState(0);
return (
<div onClick={() => setCount(count + 1)}>
{count}
</div>
);
};
@Braden1996
Copy link

Braden1996 commented Mar 5, 2019

Shouldn't line 4 be?

const [count, setCount] = React.useState(0);

@treyhuffine
Copy link
Author

Shouldn't line 4 be?

const [count, setCount] = React.useState(0);

It should be, thanks for find that bug!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment