react-lazy-hydration icon indicating copy to clipboard operation
react-lazy-hydration copied to clipboard

Stricter Typescript

Open sarink opened this issue 5 years ago • 3 comments

  • Add "strict": true to tsconfig (https://www.typescriptlang.org/tsconfig#strict)
  • Add requestIdleCallback window types and removes // ts-ignore statements
  • Add null-checking around childRef.current (it's possible that a ref's current value is null)
  • Use the built-in React.FunctionComponent<Props> type for the function
  • In the case of noWrapper, since children could be an array, and an array is not a valid return type for a component, wrap them in a fragment <>{children}</>

sarink avatar Oct 12 '20 17:10 sarink

@ScriptedAlchemy wanna check this one out instead?

sarink avatar Dec 07 '20 22:12 sarink

@hadeeb please fix these types, it just has to tell us that it returns a JSX.Element, at the moment it says it returns {}. 🙏

PascalPixel avatar Feb 10 '21 16:02 PascalPixel

bump, declare function LazyHydrate(props: Props): {}; returns wrong type

Mati365 avatar Mar 19 '21 16:03 Mati365