What is the TypeScript equivalent of this?
sessions: PropTypes.oneOfType([ PropTypes.array, PropTypes.object, ]).isRequired,
I translated this to the following 'point':
export type Sessions = [Object | Array];
However, I'm not sure how I should replace PropTypes.array and PropTypes.object.
You can consider this
type TypeSessions = Object | Array; const sessions: TypeSessions = [];
2.1m questions
2.1m answers
60 comments
57.0k users