Skip to content

Problems when using an object for the className #385

@Tydax

Description

@Tydax

Summary:

Hello there. I have been facing some issues when trying to use an object as a prop the className in the modal.
Apparently, the object is not properly translated into a string.

Steps to reproduce:

  1. Use an object for the className prop. For example:
<Modal
  className={{
    base: 'react-modal-container',
    afterOpen: '-after-open',
    beforeClose: '-before-close',
  }}
/>
  1. When inspecting the element in a browser, the div is given that className: ReactModal__Content ReactModal__Content--after-open [object Object]

Expected behavior:

The object should be transformed appropriately into a string.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions