You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -232,7 +232,7 @@ When using `useEffect`, take care not to return anything other than a function o
232
232
```ts
233
233
function DelayedEffect(props: { timerMs:number }) {
234
234
// bad! setTimeout implicitly returns a number because the arrow function body isn't wrapped in curly braces
235
-
const { timerMs } =props;
235
+
const { timerMs } =props;
236
236
useEffect(() =>setTimeout(() => {/* do stuff */}, timerMs), [timerMs])
237
237
returnnull
238
238
}
@@ -408,7 +408,7 @@ let el = <Greet />;
408
408
409
409
<details>
410
410
<summary>Typescript 2.9 and earlier</summary>
411
-
411
+
412
412
For Typescript 2.9 and earlier, there's more than one way to do it, but this is the best advice we've yet seen:
413
413
414
414
```ts
@@ -907,7 +907,7 @@ partialStateUpdate({ foo: 2 }); // this works
907
907
<summary>
908
908
Minor caveats on using <code>Partial</code>
909
909
</summary>
910
-
910
+
911
911
Note that there are some TS users who don't agree with using `Partial` as it behaves today. See [subtle pitfalls of the above example here](https://twitter.com/ferdaber/status/1084798596027957248), and check out this long discussion on [why @types/react uses Pick instead of Partial](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18365).
- [jpavon](https://github.com/jpavon/react-scripts-ts) offers an alternative react-scripts-ts with Webpack 4 and better linting.
1047
+
- [@jpavon/react-scripts-ts](https://github.com/jpavon/react-scripts-ts) alternative react-scripts with all TypeScript features using [ts-loader](https://github.com/TypeStrong/ts-loader)
1048
1048
- [webpack config tool](https://webpack.jakoblind.no/) is a visual tool for creating webpack projects with React and TypeScript
1049
1049
- <https://github.com/innFactory/create-react-app-material-typescript-redux> ready to go template with [Material-UI](https://material-ui.com/), routing and Redux
0 commit comments