FortAwesome / vue-fontawesome

Font Awesome Vue component
https://fontawesome.com
MIT License
2.39k stars 132 forks source link

Unique ID generated when using a "title" breaks SSR #491

Closed sei-jdshimkoski closed 7 months ago

sei-jdshimkoski commented 8 months ago

Describe the bug When a title attribute is added to an icon, FontAwesomeIcon generates a unique ID... unfortunately, this unique ID does not work in an SSR environment. The ID is different on the server and the client.

Reproducible test case

<FontAwesomeIcon icon="user" title="User" />

Expected behavior The unique ID should be the same on the server and the client.

Desktop (please complete the following information):

Additional context You can see this repo for an example on how to create SSR-friendly unique IDs: https://github.com/shimyshack/uid

robmadole commented 7 months ago

@sei-jdshimkoski this is not documented well but you can set props titleId and maskId to prevent these from being auto-generated. Give that a try and let us know if that doesn't work.