Closed sgorse closed 6 years ago
You should use PropTypes.shape
instead, take a look at the course
prop on the course page.
Ok, thanks for pointing that out. I am still getting a warning on the client console for the queue.id. I am getting this warning along with other warnings that do not pertain to the queue. The one that does is "Warning: Failed prop type: Invalid prop queue.id
of type number
supplied to Queue
, expected object
". Am I not setting the queue.id propType properly here?
Queue.propTypes = {
isFetching: PropTypes.bool.isRequired,
hasQueue: PropTypes.bool.isRequired,
fetchQueue: PropTypes.func.isRequired,
queueId: PropTypes.number.isRequired,
dispatch: PropTypes.func.isRequired,
queue: PropTypes.objectOf(
PropTypes.shape({
id: PropTypes.number,
name: PropTypes.string,
location: PropTypes.location,
})
),
}
Warning: Failed prop type: The prop descText
is marked as required in ConfirmLeaveQueueModal
, but its value is undefined
.
main.js:4542 Warning: Failed prop type: The prop confirmText
is marked as required in ConfirmLeaveQueueModal
, but its value is undefined
.
These were the other two warnings, but I don't think queue.js should have an effect on them
You don't need the objectOf
part, that's only if you have an object whose values are all queues. Just shape
is enough. The other bit is not related to you: https://github.com/illinois/queue/issues/79
I am having an issue fixing one of the linter errors. The initial error is " 'queue' is missing in props validation". When I try an add "queue: Proptypes.object.isRequired," to Queue.propTypes, it tells me that the Prop type object is forbidden. How can I add queue to the proptypes if its type is forbidden?