Current Behavior
Thank you for this project!
I'm not sure if I missed or didn't understand something, but when choosing the react template, react & react-dom are added as dev dependencies. When you then try to use a hook inside your library, you get a react-invalid-hook-call error. It works fine when removing them as dev dependencies and running yarn again.
Example:
export const Thing = () => {
const [fooBar, setFooBar] = React.useState('foo');
return (
<div onClick={() => setFooBar('bar')}>
the snozzberries taste like {fooBar}
</div>
);
};
Expected behavior
I would expect the template to enable me to use hooks.
Suggested solution(s)
No idea if "just removing the dev dependencies" is the proper solution. It at least worked for me.
Your environment
| Software |
Version(s) |
| TSDX |
0.5.4 |
| TypeScript |
3.4.5 |
| Browser |
Chrome 74.0.3729.108 |
| npm/Yarn |
Yarn 1.12.3 |
| Operating System |
MacOS 10.14.4 |
Current Behavior
Thank you for this project!
I'm not sure if I missed or didn't understand something, but when choosing the
reacttemplate,react&react-domare added as dev dependencies. When you then try to use a hook inside your library, you get areact-invalid-hook-callerror. It works fine when removing them as dev dependencies and runningyarnagain.Example:
Expected behavior
I would expect the template to enable me to use hooks.
Suggested solution(s)
No idea if "just removing the dev dependencies" is the proper solution. It at least worked for me.
Your environment
0.5.43.4.574.0.3729.1081.12.310.14.4