export default combineReducers({
todosReducer,
calculatorReducer,
dateReducer,
});
I've encountered a challenge while trying to incorporate TypeScript into a portion of my extensive codebase. In the code snippet above, envision the first two reducers as JavaScript and the last one as TypeScript. Despite the code editor prompting me to convert the file to TypeScript, doing so results in errors with imports and failure to compile.
import todosReducer from './todosReducer';
import calculatorReducer from './calculatorReducer';
import dateReducer from './dateReducer';
It appears that the solution is to convert both JavaScript reducers to TypeScript, which is not feasible for me at the moment. Keeping the JavaScript reducers as they are leads to compilation issues. While I have successfully compiled TypeScript and displayed content, integrating it with reducers proves to be a hurdle.
Is it possible to have a single TypeScript Reducer alongside JavaScript Reducers in combineReducers, and if yes, how can this be achieved?
Ps. The aforementioned example is simplified; the actual combineReducers contains around 15 reducers, and converting all of them at once is not a viable option.