Last active
November 23, 2015 18:02
-
-
Save akre54/80eaa63762ea499029f0 to your computer and use it in GitHub Desktop.
React SVG element monkeypatch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ReactDOM = require 'react/lib/ReactDOM' | |
ReactElement = require 'react/lib/ReactElement' | |
ReactElementValidator = require 'react/lib/ReactElementValidator' | |
SVGDOMPropertyConfig = require 'react/lib/SVGDOMPropertyConfig' | |
MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE | |
createFactory = if __DEV__ | |
ReactElementValidator.createFactory | |
else | |
ReactElement.createFactory | |
SVGDOMPropertyConfig.Properties.mask = MUST_USE_ATTRIBUTE | |
SVGDOMPropertyConfig.Properties.filter = MUST_USE_ATTRIBUTE | |
SVGDOMPropertyConfig.Properties.stdDeviation = MUST_USE_ATTRIBUTE | |
ReactDOM.filter = createFactory 'filter' | |
ReactDOM.feGaussianBlur = createFactory 'feGaussianBlur' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment