adrianhajdin / project_e_commerce

This is a code repository for the corresponding video tutorial. In this video, we're going to build a fully functional eCommerce application using commerce.js.
https://jsmastery.pro
1.88k stars 508 forks source link

TypeError: props.render is not a function #17

Open Daved-Andreh opened 3 years ago

Daved-Andreh commented 3 years ago

Hello, As I was trying this project I faced the following error after checkout Any ideas on how to fix this please?


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 | }
mrohrba4 commented 3 years ago

Any luck? Same here

Daved-Andreh commented 3 years ago

Hello, I got this response from StackOverflow and it solved it >>> "I had the same problem. I had to reinstall the earlier version of react-hook-form. Type into the terminal: npm install react-hook-form@6.2.0"

kishore1612 commented 3 years ago

Hi, try the below code in the customTextField.js

        <Controller
            control={control}
            name={name}
            render={({ field }) => (
                <TextField
                    fullWidth
                    label={label}
                    required
                />
            )}
        />