Text with changing text using setNativeProps

Has anyone understood the way to dynamically change the text on the screen without starting the render?

Most of my screen uses setNativeProps for moving parts, which means the animation is getting lagging despite using shouldComponentUpdate. I would like to use the Text tag instead of the workaround for the TextInput tag proposed in this publication for stylistic reasons.

The best scenario is a workaround that includes setNaiveProps, as it will follow the pattern for the rest of the screen; however, currently I plan to display all the numbers 0-9 on the screen to move them to their place at the moment, so any help would be greatly appreciated!

+5
source share
1 answer

As it turned out, you can format TextInputs in the same way as text elements (from what I tested). To place the text horizontally, you must set the width (which I encountered before). However, for those who are still interested in the original question, you can nest TextInputs inside the text element (one per text element, because there is no excuse and it automatically puts them in a string). The styling applied to the text element will be applied to TextInput.

+2
source

All Articles