[英]TypeError: props.render is not a function in React.js, Commerce.js, Stripe application project
I am getting the following error but not sure why, and it points to this line.我收到以下错误,但不知道为什么,它指向这一行。
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]);
also it shows:它还显示:
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 | >(
I had the same problem.我有同样的问题。 I had to reinstall the earlier version of react-hook-form.
我不得不重新安装早期版本的 react-hook-form。 Type into the terminal: npm install react-hook-form@6.2.0
在终端输入:npm install react-hook-form@6.2.0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.