dillon1000/react

Commit

Pass SVG attributes through

All attributes defined on SVG elements will now be passed directly regardless of the whitelist. The casing specified by user will be preserved, and setAttribute() will be used.

In the future we will remove support for the camel case aliases to the hyphenated attributes. For example, we currently map `strokeWidth` to `stroke-width` but this is now deprecated behind a warning. When we remove support for this we can remove some of the code paths introduced in this commit.

The purpose of this change is to stop maintaining a separate SVG property config. The config still exists for two purposes:

* Allow a migration path for deprecated camelcased versions of hyphenated SVG attributes
* Track special namespaced attributes (they still require a whitelist)

However it is no longer a blocker for using new non-namespaced SVG attributes, and users don't have to ask us to add them to the whitelist.

Fixes #1657
Browse files
Changed paths5 files
First-parent comparison
M src/renderers/dom/client/__tests__/ReactDOMSVG-test.js ModifiedM src/renderers/dom/shared/DOMPropertyOperations.js ModifiedM src/renderers/dom/shared/ReactDOMComponent.js ModifiedM src/renderers/dom/shared/SVGDOMPropertyConfig.js ModifiedM src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…