Lucifier129 / react-lite

An implementation of React v15.x that optimizes for small script size
MIT License
1.73k stars 100 forks source link

Disappeared SVG tags `use` in IE10 - IE11. #85

Open zazagag opened 7 years ago

zazagag commented 7 years ago

I am using svg through tag use and IE10 - IE11 have removed all of them(react-lite@0.15.27).

Got from server: <svg class="icon-twitter" width="16px" height="16px" data-reactid="8"><use xlink:href="#twitter" /></svg>.

Got after react-lite applying: <svg class="icon-twitter" width="16px" height="16px" data-reactid="8"></svg>.

In the same time React@15.3.2 has no this problem, all my SVG were displayed correctly.

Lucifier129 commented 7 years ago

thx feedback, I will check this problem and try to fix it as soon.

Lucifier129 commented 7 years ago

I found it just work the same as react.

import React, { Component } from 'react-lite'
import ReactDOM from 'react-lite'

function Test() {
    return (
        <svg className="icon-twitter" width="16px" height="16px">
            <use xlinkHref="#twitter" />
        </svg>
    )
}

ReactDOM.render(
    <Test />,
    document.getElementById('root')
)

In fact, react-lite will replace the whole dom tree from server-side with new dom tree, and data-reactid="8" will not appeare, so I think maybe something else cause this problem.