Э
Size: a a a
Э
SS
BS
Э
TK
Э
import {applyMiddleware, createStore} from 'redux';
import thunk from 'redux-thunk';
import rootReducer from './reducers';
export default function configureStore(initialState) {
return createStore(rootReducer, initialState, applyMiddleware(thunk));
}
SS
SS
SS
import {applyMiddleware, createStore} from 'redux';
import thunk from 'redux-thunk';
import rootReducer from './reducers';
export default function configureStore(initialState) {
return createStore(rootReducer, initialState, applyMiddleware(thunk));
}
SS
Э
Б
TK
BS
export default connect(mapStateToProps, {login})(App)это? Так он крашится и не даёт
SS
SS
useEffect(() => {
let isUnmounted = false;
async function fetchData(): Promise<void> {
if (isUnmounted) {
return;
}
setShowLoading(true);
try {
await storageService.fetchRecalls();
} catch (e) {
console.error(e)
} finally {
setShowLoading(false);
}
}
fetchData();
return () => {
let isUnmounted = true;
}
}, []);
Э
const mapStateToProps = state => ({
userReducer: state.userReducer,
});
TK
useEffect(() => {
let isUnmounted = false;
async function fetchData(): Promise<void> {
if (isUnmounted) {
return;
}
setShowLoading(true);
try {
await storageService.fetchRecalls();
} catch (e) {
console.error(e)
} finally {
setShowLoading(false);
}
}
fetchData();
return () => {
let isUnmounted = true;
}
}, []);
BS
const mapStateToProps = state => ({
userReducer: state.userReducer,
});