reactbook
reactbook copied to clipboard
Fix flow complaining that href and className for Button.js
Hi Stoyan,
Finished reading your book. Love it! I found this issue below with flow.
js/source/discover.js:28
28: <div>Button with onClick: <Button onClick={() => alert('ouch')}>Click me</Button></div>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ React element `Button`
11: const Button = (props: Props) =>
^^^^^ property `className`. Property not found in. See: js/source/components/Button.js:11
28: <div>Button with onClick: <Button onClick={() => alert('ouch')}>Click me</Button></div>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ props of React element `Button`
js/source/discover.js:28
28: <div>Button with onClick: <Button onClick={() => alert('ouch')}>Click me</Button></div>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ React element `Button`
11: const Button = (props: Props) =>
^^^^^ property `href`. Property not found in. See: js/source/components/Button.js:11
28: <div>Button with onClick: <Button onClick={() => alert('ouch')}>Click me</Button></div>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ props of React element `Button`
The fix allows these two to be "undefined".