-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass refs to the svg element #13
Comments
I think converting to a class component might be the best option here. cc @lencioni, do you think that would cause any issues? |
I don't think it would cause any problems. It won't be able to take advantage of optimizations that React will make to rendering functional components in the future though, so that's a bummer. But on the flipside, you could also probably add |
@lencioni We accept arbitrary props at the top level to customize the svg. Could we just use PureComponent? |
Ah that's right. Yeah that should work. Won't be able to support earlier versions of React before PureComponent existed. Also, I'm not sure how much difference it will make for such low-level components but I don't see any reason not to. |
Hello! What do you think about #36 ? |
Kinda unexpected that this is still not supported - are people using alternative babel plugins for this? Edit
Diff is here would love to get this merged into mainline. I'm not sure people are using pre-16.8.0 versions of React anymore. |
@andyrichardson I no longer use this plugin, as I don’t think this kind of build-step magic is really good anymore. I’ve moved to using something like SVGR to generate full react components, and just have those checked into the codebase. I’ve found this pattern to be far superior. |
@kesne thanks for letting me know. I'll check that out 👍 |
Is there any news with that? |
Still having this issue Considering moving to SVGR instad |
Hey, do you have any idea on how this plugin could support refs? Functional components don't support refs, so out of the box, it's not possible to simply write
<CloseSvg ref={node => this.node = node} />
. Switching to a class component could work. Supporting some form ofinnerRef
property could also work. What is your opinion on the matter?The text was updated successfully, but these errors were encountered: