I started getting this warning on my react-modal components:
Warning: Failed propType: Required prop
contentLabelwas not specified inModal.
It doesn't prevent the modal from working correctly, I just see the warning in the dev tools console. I can pass this prop in by specifying some random string, but I do not understand what this is actually used for, and why it is required.
contentLabelimproves accessibility. You probably don't notice it, but in certain situations thispropcan help your users understand what the modal is about. From their repository:The value of
contentLabelis set as anaria-labelon the modal element. This helps assistive technology, like screen readers, to add a label to an element that would otherwise be anonymous. People with visual impairment for example can make more sense out of your modal when added.