infinitered / ignite

Infinite Red's battle-tested React Native project boilerplate, along with a CLI, component/model generators, and more!
MIT License
17.48k stars 1.38k forks source link

Allow passing ref to Text component in Ignite boilerplate #2758 #2765

Open Aniganesh opened 3 weeks ago

Aniganesh commented 3 weeks ago

Please verify the following:

Describe your PR

This PR allows passing ref to the Text component in boilerplate. Have added the feature and a demo in Demo Community Screen. @frankcalise Let me know if I need to add something or if things need to be moved around.

Aniganesh commented 3 weeks ago

This fixes #2758

lindboe commented 3 weeks ago

Hi @Aniganesh!

For understanding your PR and improving documentation, could you let us know your use case for forwarding the Text ref?

Aniganesh commented 3 days ago

Hey! Extremely sorry for not responding for this long. The use case for this was that I had to position a bunch of \ components and also adjust their positioning based on their heights. Initially I used refs and then called measure() on the refs. That's when I got the idea for the PR. Later, I realized my purpose is better served with the onLayout callback and went with that instead. Thought I'd still add the PR in case anyone has a similar purpose and wants to use refs.

Once again, apologies for not responding for so long.