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,
});