react-lazy-hydration
react-lazy-hydration copied to clipboard
Stricter Typescript
- Add
"strict": truetotsconfig(https://www.typescriptlang.org/tsconfig#strict) - Add
requestIdleCallbackwindow types and removes// ts-ignorestatements - Add null-checking around
childRef.current(it's possible that a ref'scurrentvalue isnull) - Use the built-in
React.FunctionComponent<Props>type for the function - In the case of
noWrapper, sincechildrencould be an array, and an array is not a valid return type for a component, wrap them in a fragment<>{children}</>
@ScriptedAlchemy wanna check this one out instead?
@hadeeb please fix these types, it just has to tell us that it returns a JSX.Element, at the moment it says it returns {}. 🙏
bump, declare function LazyHydrate(props: Props): {}; returns wrong type