0

I want to load only state which are specific to particular route url. Currently I am loading index.js which has below code.

import A1 from 'A1Reducer';
import A2 from 'A2Reducer';
import B1 from 'B1Reducer';
import B2 from 'B2Reducer';

export default combineReducers({
  A1: A1,
  A2: A2,
  B1: B1,
  B2: B2
});

As per above code I am loading all the states on page load. which is used for different routes

States with name 'A' is used in route /A and States with name 'B' is used in route /B.

So I am storing State B even though it is not used in route A.

I want to create a store based on router route. Please suggest

Mohammed Farooq
  • 227
  • 1
  • 5
  • 23

0 Answers0