我正在为我的用词。 但我有问题。
页: 1 但是,当我把它放在aga子中时,它就显示:
[Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
- You might have mismatching versions of React and the renderer (such as React DOM)
- You might be breaking the Rules of Hooks
- You might have more than one copy of React in the same app See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.]
http://。 如果yes,how? 如果no,你可以提出解决办法。
最终解决办法是从沙迦传递信息。
这是我的传闻。 js file:
export function toastLoginSuccess() {
ToastAndroid.show(
LANGUAGES.toastLoginSuccess,
ToastAndroid.SHORT,
ToastAndroid.TOP,
);
}
页: 1
www.un.org/Depts/DGACM/index_french.htm
I want change it to const LANGUAGES = React.useContext(LanguageContext).language;
而Saga是一份类似于:
export function* fetchSigninSaga(action) {
try {
// ...
yield Toast.toastLoginSuccess())
} catch (error) {
// ...
yield Toast.toastLoginFail();
}
}