Skip to content

Prevent javascript URLs warning in React 16.9 #2384

Closed
bluecanvas/design-system-react
#1
@hannes-o-brunner

Description

@hannes-o-brunner

@salesforce/design-system-react@0.10.12

React 16.9 emits the following warning:

Warning: A future version of React will block javascript: URLs as a security precaution. Use event 
handlers instead if you can. If you need to generate unsafe HTML try using 
dangerouslySetInnerHTML instead. React was passed "javascript:void(0);".

See facebook/react#16592 for the feature issue
And some related discussions here: facebook/react#16382

Activity

stale

stale commented on Dec 24, 2019

@stale

This issue has been automatically marked as stale, because it has not had recent activity. It will be closed if no further activity occurs. Maintainers are responsible for tech debt and project health. This is most likely a new components or component feature request. Please submit a pull request for or request feedback on this feature. Thank you.

xoob

xoob commented on May 11, 2020

@xoob
Contributor

Just a heads-up, this is causing npm run test:unit to fail hard.

  SLDSAlert:
    Dismiss alert
      ✗ "before each" hook: mountComponentInside for "calls onRequestClose handler"
	Error: Warning: A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.%s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Participants

      @xoob@interactivellama@hannes-o-brunner

      Issue actions

        Prevent javascript URLs warning in React 16.9 · Issue #2384 · salesforce/design-system-react