React-native-reanimated: How correctly path Animated Value to the SVG Text component

Created on 24 Mar 2020  路  7Comments  路  Source: software-mansion/react-native-reanimated

How can I render animated value inside Svg Text component? I've tried it like this, but no luck.

import Svg, { Text } from "react-native-svg";
import Animated from "react-native-reanimated";

const AnimatedText = Animated.createAnimatedComponent(Text);

export default () => {
  const numberValue = new Animated.Value(10);
  return (
    <Svg style={styles.container} viewBox="0 0 212 239">
      <AnimatedText>{numberValue}</AnimatedText>
    </Svg>
  );
};
鉂換uestion

All 7 comments

@troublediehard checkout the <ReText> component from react-native-redash.. it uses an uneditable TextInput to display Animated Value https://wcandillon.github.io/react-native-redash/strings#retext

@mikedemarais thanks, not sure if it something I'm looking for, but I'll check it anyway.

Have you finally found something that helps you displaying animated string value to text on svg ?

@grean looks like it is not possible with SVG text right now.

This is not a direct issue of reanimated. This is more of Stack Overflow like question. That's why I am closing this issue.

hi @jkadamczyk, is it issue of react-native-svg. On what side it is possible to fix, what do you think?

@troublediehard I am not sure whether this is an issue of either react-native-svg nor react-native-reanimated. But as far as the question is concerned I guess it is more of a react-native-svg question rather than react-native-reanimated question 馃檪.

Have a good day!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bjartebore picture bjartebore  路  3Comments

nextriot picture nextriot  路  3Comments

ArsalanCsquare picture ArsalanCsquare  路  3Comments

colinux picture colinux  路  3Comments

alexfov picture alexfov  路  3Comments