Skip to content

Javascript to Typescript

Nafiz Islam edited this page Feb 28, 2025 · 1 revision
  • Convert https://react-redux.js.org/api/connect to https://react-redux.js.org/api/hooks (if connect is used)
  • Provide component props type interface (if it's not already provided/exported)
  • Provide specific type for each field of the interface (not any).
  • Provide specific type for all function parameters in the typescript code
  • Provide specific type for all variables declared
  • Use enum to represent different constant values where it makes sense.

Note: Some type can be omitted if it's already inferred. You can find out by hovering over them to see their type.

Clone this wiki locally