I started getting this warning on my react-modal components:
Warning: Failed propType: Required prop
contentLabel
was 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.
contentLabel
improves accessibility. You probably don't notice it, but in certain situations thisprop
can help your users understand what the modal is about. From their repository:The value of
contentLabel
is set as anaria-label
on 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.