![](/img/trans.png)
[英]TypeError: props.render is not a function (React hook form)
[英]TypeError: props.render is not a function in React.js, Commerce.js, Stripe application project
我收到以下錯誤,但不知道為什么,它指向這一行。
useEffect(() => {
if (cart.id) {
const generateToken = async () => {
25 | try {
26 | const token = await commerce.checkout.generateToken(cart.id, { type: 'cart' });
27 |
> 28 | setCheckoutToken(token);
| ^ 29 | } catch {
30 | if (activeStep !== steps.length) history.push('/');
31 | }
};
generateToken();
}
}, [cart]);
它還顯示:
1 | import { ControllerProps, FieldPath, FieldValues } from './types';
2 | import { useController } from './useController';
3 |
> 4 | const Controller = <
5 | TFieldValues extends FieldValues = FieldValues,
6 | TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
7 | >(
我有同樣的問題。 我不得不重新安裝早期版本的 react-hook-form。 在終端輸入:npm install react-hook-form@6.2.0
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.