ignite icon indicating copy to clipboard operation
ignite copied to clipboard

Allow passing ref to Text component in Ignite boilerplate #2758

Open Aniganesh opened this issue 1 year ago • 3 comments

Please verify the following:

  • [x] yarn test jest tests pass with new tests, if relevant
  • [x] yarn lint eslint checks pass with new code, if relevant
  • [x] yarn format:check prettier checks pass with new code, if relevant
  • [x] README.md (or relevant documentation) has been updated with your changes

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 avatar Sep 06 '24 10:09 Aniganesh

This fixes #2758

Aniganesh avatar Sep 10 '24 15:09 Aniganesh

Hi @Aniganesh!

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

lindboe avatar Sep 10 '24 21:09 lindboe

Hey! Extremely sorry for not responding for this long. The use case for this was that I had to position a bunch of <Text /> 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.

Aniganesh avatar Sep 30 '24 16:09 Aniganesh

@Aniganesh are you still interested in resolving the conflicts here or should we close this?

frankcalise avatar Mar 05 '25 13:03 frankcalise