React template not working #612

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

Originally created by @theCuriousOne on 7/3/2017

When you run the template ReactReduxSpa with dotnet run it will load up perfectly.
But when you delete the server and the client "dist" folders an typescript error will be shown in configureStore.ts (typescript version 2.3.4) which can be circumvented if you do this:

const createStoreWithMiddleware = compose( applyMiddleware(thunk, routerMiddleware(history)) )(createStore);

And if you upgrade the typescript to version 2.4.1 (latest at the moment) there will be another error:

TS2322: Type '(state: WeatherForecastsState, action: KnownAction) => WeatherForecastsState' is not assignable to type 'Reducer<WeatherForecastsState>'.

      Types of parameters 'action' and 'action' are incompatible.

        Type 'A' is not assignable to type 'KnownAction'.

          Type 'Action' is not assignable to type 'KnownAction'.

            Type 'Action' is not assignable to type 'RequestWeatherForecastsAction'.

              Property 'startDateIndex' is missing in type 'Action'.

                Type 'A' is not assignable to type 'ReceiveWeatherForecastsAction'.

                  Type 'Action' is not assignable to type 'ReceiveWeatherForecastsAction'.

                    Property 'startDateIndex' is missing in type 'Action'.

(still looking for a workaround on this one)
So.... the template is not working as expected :(

*Originally created by @theCuriousOne on 7/3/2017* When you run the template ReactReduxSpa with dotnet run it will load up perfectly. But when you delete the server and the client "dist" folders an typescript error will be shown in configureStore.ts (typescript version 2.3.4) which can be circumvented if you do this: `const createStoreWithMiddleware = compose( applyMiddleware(thunk, routerMiddleware(history)) )(createStore);` And if you upgrade the typescript to version 2.4.1 (latest at the moment) there will be another error: ``` TS2322: Type '(state: WeatherForecastsState, action: KnownAction) => WeatherForecastsState' is not assignable to type 'Reducer<WeatherForecastsState>'. Types of parameters 'action' and 'action' are incompatible. Type 'A' is not assignable to type 'KnownAction'. Type 'Action' is not assignable to type 'KnownAction'. Type 'Action' is not assignable to type 'RequestWeatherForecastsAction'. Property 'startDateIndex' is missing in type 'Action'. Type 'A' is not assignable to type 'ReceiveWeatherForecastsAction'. Type 'Action' is not assignable to type 'ReceiveWeatherForecastsAction'. Property 'startDateIndex' is missing in type 'Action'. ``` (still looking for a workaround on this one) So.... the template is not working as expected :(
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#612
No description provided.