question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ReText text not changed but printed well in console

See original GitHub issue

Description

The SharedValue<string> from useDeriviedValue is changed well but doesn’t affect ReText well…

  const percentageText = useDerivedValue(() => {
    const factor = cursorX.value / graphWidth; // 0(left end in graph) ~ 1(right end in graph)
    const dataIndex = Math.round(factor * (dataCount - 1)); // 0 | 1 | 2 | ... | n - 1

    const text = `상위 ${datas[dataIndex].toFixed(1)}%`;
    console.log(text);
    return text;
  });

...

<ReText text={percentageText} />

image 1

Is there any something wrong in my code?

Environment

"react": "16.13.1",
"react-native": "0.63.3",
"react-native-reanimated": "2.0.0-alpha.9.1",
"react-native-redash": "15.11.1",

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mrbrentkellycommented, Nov 29, 2020

I believe you need to whitelist the text native prop for this to work…

Animated.addWhitelistedNativeProps({ text: true });

Source https://github.com/software-mansion/react-native-reanimated/issues/1448#issuecomment-730482678

0reactions
mym0404commented, Dec 11, 2020

Thank you for reporting this. You can use Animated.addWhitelistedNativeProps({ text: true }); as a temporary fix. Just out of curiosity, how do you update the <Text /> component on the JS thread without triggering a React re-render?

@wcandillon Thank you fir fixes. In my last comment, the updateXXX methods are set state from useState. So the React re-render has been triggered.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I edit text that has already been printed in Console in ...
What I'm trying to do is print text in a Console application, which the user can then edit and modify, and then press...
Read more >
Links - Usability & Web Accessibility - Yale University
In that case, a screen reader may only read the link text and not the surrounding text. Speech recognition software allows a user...
Read more >
Text on screen - freebasic.net
Be able to position at an x,y point on that screen to print or input text, ideally by line, character position and not...
Read more >
Creating Accessible Emails
Because there was no alt text added to the image, the email does not contain any content when images are not displayed. Alt...
Read more >
re – Regular Expressions - Python Module of the Week
Purpose: Searching within and changing text using formal patterns. ... import re text = 'abbaaabbbbaaaaa' pattern = 'ab' for match in re.findall(pattern, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found