reactbook icon indicating copy to clipboard operation
reactbook copied to clipboard

Fix flow complaining that href and className for Button.js

Open alvinleonard opened this issue 9 years ago • 0 comments

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".

alvinleonard avatar Jun 28 '16 06:06 alvinleonard