redux template: automatically infer FetchData's new props type #450

Closed
opened 2025-08-09 17:16:20 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @stephtr on 9/2/2017

After being connected to redux's store the props type isn't the same anymore since WeatherForecastsState gets filled by the store.

The template worked because when using the FetchData component within the Route component it seems like its type doesn't get checked accurately. However using the component as <FetchData ... /> generates an error since the properties of WeatherForecastsState were seemingly missing.

The type definition of redux's connect has been built in such a way, that the new props type gets automatically infered.

*Originally created by @stephtr on 9/2/2017* After being connected to redux's store the props type isn't the same anymore since `WeatherForecastsState` gets filled by the store. The template worked because when using the `FetchData` component within the `Route` component it seems like its type doesn't get checked accurately. However using the component as `<FetchData ... />` generates an error since the properties of `WeatherForecastsState` were seemingly missing. The type definition of redux's `connect` has been built in such a way, that the new props type gets automatically infered.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#450
No description provided.