Closed rohmanhm closed 7 years ago
@autobind handleReset () { this.setState({ imgSrc: undefined }); }
That code will throws an error in the browser console. This is the error message.
App.tsx:127 Uncaught TypeError: Cannot read property 'setState' of null at App.handleReset (http://localhost:3000/static/js/bundle.js:33337:14) at Object.ReactErrorUtils.invokeGuardedCallback (http://localhost:3000/static/js/bundle.js:17522:17) at executeDispatch (http://localhost:3000/static/js/bundle.js:17305:22) at Object.executeDispatchesInOrder (http://localhost:3000/static/js/bundle.js:17328:6) at executeDispatchesAndRelease (http://localhost:3000/static/js/bundle.js:16716:23) at executeDispatchesAndReleaseTopLevel (http://localhost:3000/static/js/bundle.js:16727:11) at Array.forEach (native) at forEachAccumulated (http://localhost:3000/static/js/bundle.js:17625:10) at Object.processEventQueue (http://localhost:3000/static/js/bundle.js:16930:8) at runEventQueueInBatch (http://localhost:3000/static/js/bundle.js:24552:19)
Here's my tsconfig.json configuration
tsconfig.json
{ "compilerOptions": { "outDir": "build/dist", "module": "commonjs", "target": "es5", "lib": ["es6", "dom"], "sourceMap": true, "allowJs": true, "jsx": "react", "moduleResolution": "node", "rootDir": "src", "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noImplicitThis": true, // "noImplicitAny": true, "strictNullChecks": true, "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true, "experimentalDecorators": true }, "exclude": [ "node_modules", "build", "scripts", "acceptance-tests", "webpack", "jest", "src/setupTests.ts" ], "types": [ "typePatches" ] }
You missing to publish this https://github.com/andreypopp/autobind-decorator/commit/a716cbdf238166925d4dcf26a1bb3f9fd269bbfb
That PR make works with Typescript
published v1.4.1
v1.4.1
That code will throws an error in the browser console. This is the error message.
Here's my
tsconfig.json
configuration