Skip to content

Why do all object keys for className overlayClassName object prop need to be required?Β #578

Open
@indiesquidge

Description

@indiesquidge

Summary:

#536 introduced a specification for the className and overlayClassName props when passed as objects. I am interested in knowing whether or not all keys on the prop object need to be required. I would prefer it not be required to implement all three keys all the time (unless there is some a11y gain or the removal of some subtle bug that I'm missing).

Steps to reproduce:

  1. Create a <ReactModal> and supply it an overlayClassName prop as an object, but exclude one of the three possible object keys (i.e. base, afterOpen, beforeClose)

  2. Upon the modal render, you should see a prop warning in your console

Expected behavior:

No proptypes warning for missing object keys.

Link to example of issue:

I made a codepen that shows the warning, but I'm not sure it's necessary to show the point. It's obvious by the code that the proptype warning will occur.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions