Closed tgrrr closed 4 years ago
Hi, thanks for opening this up. As far as I remember, there was some issue in running the thunk example locally. Does it run for you?
It worked for me. However, I'll test it. Do you have a link to the thunk bugs?
It's not a bug. It works with CRA. (Run it in the examples/* folder or in codesandbox)
Maybe it's fixed with npm run examples:* too, because I recently updated all devDependencies. I'll try it in my machine later.
Hmm, it doesn't work for me.
If I remove the file examples/08_thunk/tsconfig.json
, it works.
But just running DIR=08_thunk webpack-dev-server
gives me, the following error in the browser.
./examples/08_thunk/src/App.tsx 8:32
Module parse failed: Unexpected token (8:32)
File was processed with these loaders:
* ./node_modules/ts-loader/index.js
You may need an additional loader to handle the result of these loaders.
| var Counter_1 = require("./Counter");
| var Person_1 = require("./Person");
> var App = function () { return (<react_1.StrictMode>
| <state_1.GlobalStateProvider>
| <h1>Counter</h1>
./examples/08_thunk/src/App.tsx
[tsl] ERROR in /.../react-hooks-global-state/examples/08_thunk/src/App.tsx(6,21)
TS6142: Module './Counter' was resolved to '/.../react-hooks-global-state/examples/08_thunk/src/Counter.tsx', but '--jsx' is not set.
...
As far as I remember examples/08_thunk/tsconfig.json
is required for codesandbox to run the 08_thunk example.
I need some configuration to let it read ./tsconfig.json
instead of examples/08_thunk/tsconfig.json
.
I wonder how you made it work. 🤔
I was able to remove 08_thunk/tsconfig.json
and it's working now.
Add back
"examples:thunk": "DIR=08_thunk webpack-dev-server",
to package.json to run thunk example