Как мне избавиться от предупреждений об ошибках реагирования, предлагающих изменить атрибуты svg на верблюжий регистр? ⇐ CSS

Разбираемся в CSS
Гость
Как мне избавиться от предупреждений об ошибках реагирования, предлагающих изменить атрибуты svg на верблюжий регистр?

Сообщение Гость »


Recently my team upgraded from React 15.1 to 15.3. With this upgrade comes these errors:

Код: Выделить всё

warning.js:36 Warning: Unknown DOM property stroke-width. Did you mean strokeWidth?     in g     in svg     in div (created by Unknown)     in div (created by Unknown)     in Unknown warning.js:36 Warning: Unknown DOM property fill-rule. Did you mean fillRule?     in g     in svg     in div (created by Unknown)     in div (created by Unknown)     in Unknown 
I understand that react wants multi-word properties as camel case, but these SVGs need to be usable in a non-React context. Also, they aren't mentioned in any js or jsx file, just in css as a background image like this.

Код: Выделить всё

.icon-sprite {     background-image: url('~icons/sprite.svg'); } @mixin spriteIcon72( $spriteVals ) {     @extend .icon-sprite;     background-repeat: no-repeat;     background-position: nth($spriteVals, 1) nth($spriteVals, 2);     background-size: 1300px 600px; } 
The class that the react component would use itself looks like this

Код: Выделить всё

.active-icon {     @include spriteIcon72($sprite-active); } 
How can I get React to stop logging errors in the console about this?


Источник: https://stackoverflow.com/questions/390 ... ributes-to

Вернуться в «CSS»