Templarian / MaterialDesign-React

Dist for Material Design Icons React Component for JS/TypeScript
https://materialdesignicons.com
MIT License
142 stars 20 forks source link

Supplied refs are not propagating to the element #24

Closed mririgoyen closed 5 years ago

mririgoyen commented 5 years ago

Supplying a ref to the <Icon> element does not work properly, likely because refs need to be forwarded in a way different from all other props.

(Issue likely affects <Stack>s as well.)

See: https://reactjs.org/docs/forwarding-refs.html

Templarian commented 5 years ago

@goyney Can you have them just npm install the master branch and let me know if it works. I'll do a release with this fix if it's all good.

Templarian commented 5 years ago

Fixed this to work with TypeScript. Oversight on the props validation. Let me know this works and I'll push 1.2.0.

Unit testing isn't possible at this time with Enzyme for refs. I put a placeholder.

Templarian commented 5 years ago

@goyney Were they able to test this?

mririgoyen commented 5 years ago

Yep, the changes made are good. Feel free to close this upon publish to NPM. :)

Templarian commented 5 years ago

Published!