Skip to content
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

fix: useAnimatedProps text not working on web #6691

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

5ZYSZ3K
Copy link

@5ZYSZ3K 5ZYSZ3K commented Nov 12, 2024

fix: web-example not starting because of metro-resolver version mismatch
feature: Add AnimatedPathExample to the repo

Summary

Test plan

You can check example app. Examples:

  • AmountExample
  • JSPropsExample

@patrycjakalinska
Copy link
Contributor

Hi @5ZYSZ3K, thanks for creating this pull request c: Can you split it so one PR would have only one responsibility? Currently we have 2 fixes and one feature, ideally each one of these would be separate.

About fix: web-example not starting because of metro-resolver version mismatch - i think currently the web-example is starting (kudos to @tomekzaw and this PR), so no need for that.

@oxbits
Copy link

oxbits commented Jan 25, 2025

Hello @5ZYSZ3K and @patrycjakalinska

We see our issue has been referenced in this pull request.

We see another pull request has been referenced but we do not think it fixes the issue we are experiencing.

Summary

@5ZYSZ3K
Copy link
Author

5ZYSZ3K commented Jan 27, 2025

Hi @5ZYSZ3K, thanks for creating this pull request c: Can you split it so one PR would have only one responsibility? Currently we have 2 fixes and one feature, ideally each one of these would be separate.

About fix: web-example not starting because of metro-resolver version mismatch - i think currently the web-example is starting (kudos to @tomekzaw and this PR), so no need for that.

Hi, I've rebased it and got rid of an additional example - now it's just the fix + a showcase on already existing examples (which were affected by the bug)

@5ZYSZ3K
Copy link
Author

5ZYSZ3K commented Jan 27, 2025

Hello @5ZYSZ3K and @patrycjakalinska

We see our issue has been referenced in this pull request.

We see another pull request has been referenced but we do not think it fixes the issue we are experiencing.

Summary

If you meant that my fix is not working in your case, could you try it again, but with the textAdapter passed to useAnimatedProps?
The textAdapter should be created like that:

const textAdapter = createAnimatedPropAdapter(
  (props: Record<string, unknown>) => {
    props._setAttributeDirectly = true;
    props.value = props.text;
  },
  ['value']
);

@5ZYSZ3K
Copy link
Author

5ZYSZ3K commented Jan 27, 2025

A quick explanation on why it wasn't working:
Updating text prop on TextInput won't work because React implements _valueTracker there, so I added the possibility to set a value directly
facebook/react#11488
https://github.com/facebook/react/blob/main/packages/react-dom-bindings/src/client/inputValueTracking.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants