-
Notifications
You must be signed in to change notification settings - Fork 274
Gradually use React hooks on the project #406
Conversation
ERROR in /home/travis/build/wasdk/WebAssemblyStudio/src/components/Split.tsx [tsl] ERROR in /home/travis/build/wasdk/WebAssemblyStudio/src/components/Split.tsx(113,3) TS4031: Public property 'onResizerMouseMove' of exported class has or is using private name 'MouseEvent'. ERROR in /home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx [tsl] ERROR in /home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx(68,3) TS4031: Public property 'onDoubleClick' of exported class has or is using private name 'MouseEvent'. ERROR in /home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx [tsl] ERROR in /home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx(113,3) TS4031: Public property 'onMouseHandle' of exported class has or is using private name 'MouseEvent'. ERROR in /home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx [tsl] ERROR in /home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx(118,3) TS4031: Public property 'onClick' of exported class has or is using private name 'MouseEvent'. ERROR in /home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx [tsl] ERROR in /home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx(122,3) TS4031: Public property 'onDoubleClick' of exported class has or is using private name 'MouseEvent'. ERROR in /home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx [tsl] ERROR in /home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx(126,3) TS4031: Public property 'onClose' of exported class has or is using private name 'MouseEvent'.
Enzym, that is used on the test suit, doesn't support hooks reactjs/rfcs#71 (comment) not sure how to proceed, either disabling the tests, moving away from Enzym or I don't know. |
Many things from React 16 not supported yet by enzym. See tracker: enzymejs/enzyme#1553 (comment) |
So WDYT about https://github.com/kentcdodds/react-testing-library maybe? |
It does not make any sense to disable testing just for new React syntax. |
@yurydelendik right, obviously |
@ebraminio The tests depend a lot on enzyme at the moment so it would be an extensive effort to migrate to react-testing-library or react-test-renderer. However, work is done here to add hooks support to enzyme so I'll guess we just have to wait for that 🔜 |
So let's close this, thanks :) |
React 16.8.0 is now released with enabled hooks and now we can use them which leads to a good cleaning up.
The final goal will be removal of all the "extends React.Component" from the project but I've sent the patch anyway after changing just two of them to get some feedback here and maybe we can merge this and gradually do the rest.
Thanks!