M
M
mixerstyle2018-08-27 15:58:03
JavaScript
mixerstyle, 2018-08-27 15:58:03

Uncaught TypeError: _propTypes2.default.ArrayOf is not a function?

I get this error "Uncaught TypeError: _propTypes2.default.ArrayOf is not a function". And I do not understand what the problem is and I will be very grateful for the help and clarification. Below is the entire validation part with PropTypes:

OrdersTab.propTypes = {
  toggleTab: PropTypes.func.isRequired,
  orders: PropTypes.ArrayOf(
    PropTypes.shape({
      id: PropTypes.number,
      orderedProducts: PropTypes.arrayOf(PropTypes.string),
      orderedAt: PropTypes.string,
    }),
  ).isRequired,
  addOrder: PropTypes.func.isRequired,
  orderIsReady: PropTypes.func.isRequired,
};

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2018-08-27
@mixerstyle

orders: PropTypes.ArrayOf <<<- capitalized, but it should be arrayOf

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question