Merry Chrismas... I got a React project structured like below
- My project
|- common (redux and redux-persist installed)
|- mobile (... with react-native init)
|- web (... with create react app)
I tried then to import a basic redux from common in mobile and got an error Here's the code
import default_storage from "redux-persist/lib/storage"
import default_storage from "redux-persist/lib/storage";
import thunk from "redux-thunk";
...
export default (storage = default_storage) => {
const store = createStore(
combineReducers({
auth: persistReducer(
{ key: "auth", storage},
authReducer
),
event: eventReducer,
}),
applyMiddleware(thunk)
);
return store
};
...
When I try to call the function in mobile passing AsyncStorage as parameter I got an error saying the function couldn't compile because of the fact that there's no part of common that can compile the native part of AsyncStorage. I tried first with adding fields resolve in babel.config.js but it actually doesn't work If someone already did this kinda Structure before, would you share ya code please. Just how to structure the code
Thanks guys