Skip to content

Inline style injection used in v11 not compatible with Content-Security-Policy #1209

@GWellerGMSL

Description

@GWellerGMSL

FYI, using react-toastify v11 with CSP response headers causes the following errors...

Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.

Using the undocumented unstyled import seems to resolve the issue, but this feels brittle to me. It would be great if you could explore other options for injecting the stylesheet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions