icon with mask may cause memory leak on ssr [nodejs]
See original GitHub issueimport React from 'react'
import FontAwesomeIcon from '@fortawesome/react-fontawesome'
const Test = () => (
<div>
<FontAwesomeIcon icon="star" mask="circle" />
</div>
)
export default Test
when i add fontawesome icon with mask props, variable name “_uniqueId” in file (@fortawesome/fontawesome/index.js) keep increasing on server side everytime the component was rendered through ReactDOM.renderToString(appComponent)
@fortawesome/fontawesome/index.js
what i got from server rendered
<svg aria-hidden="true" data-prefix="fas" data-icon="star" class="svg-inline--fa fa-star fa-w-16 " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><defs><clipPath id="clip-12"><path fill="currentColor" d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"></path></clipPath><mask x="0" y="0" width="100%" height="100%" id="mask-11" maskUnits="userSpaceOnUse" maskContentUnits="userSpaceOnUse"><rect x="0" y="0" width="100%" height="100%" fill="white"></rect><g transform="translate(256 256)"><g transform="translate(0, 0) scale(1, 1) rotate(0 0 0)"><path fill="black" d="M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z" transform="translate(-288 -256)"></path></g></g></mask></defs><rect fill="currentColor" clip-path="url(#clip-12)" mask="url(#mask-11)" x="0" y="0" width="100%" height="100%"></rect></svg>
clipPath id keep increasing
First
<clipPath id="clip-1">
Second
<clipPath id="clip-2">
Third
<clipPath id="clip-3">
…
Eighth
…
Twentieth
…
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:10 (5 by maintainers)
Any progress on this?
Hey Rob! Just wondering if you folks have made any progress here or if you have any sort of timelines for when a fix for this will be available.