1

I get the "× TypeError: Cannot read properties of null (reading 'useReducer')" when I use the following code:

import React, { useReducer,useContext, useEffect  } from 'react';


 const [{ loading, error, order, successPay, loadingPay }, dispatch] =
        useReducer(reducer, {
            loading: true,
            order: {},
            error: '',
            successPay: false,
            loadingPay: false,
        });
Amila Senadheera
  • 12,229
  • 15
  • 27
  • 43

0 Answers0