You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason why I don't like that approach is the additional wrapping that you have per component. When you're rending a forwardRef your render tree will actually be:
This might not seem like a big problem, which is true for when you have a single element you're working with. With an SVG asset it's not uncommon to have a deeply nested structure of paths, groups, and other shapes and when you need to debug one of those elements this is going to add up. In addition to that, it's more painful to write tests against due to this additional wrapping.
Problem:
You can use
ref
's with stateless functions. This means that non of thesvgs
components can have aref
assigned to them.Solution:
Change all stateless functions to class's.
The text was updated successfully, but these errors were encountered: