Skip to content

Conversation

@patrickkabwe
Copy link
Owner

Add support for animating NitroText props using React Native Reanimated. This allows text properties (text, fontSize, fontColor, letterSpacing) to be animated directly on the UI thread for smooth, performant animations.

const AnimatedNitroText = Animated.createAnimatedComponent(NitroText);

const progress = useSharedValue(0);
const fontSize = useSharedValue(16);

const animatedProps = useAnimatedProps(() => ({
  text: 'Animated text',
  fontSize: fontSize.value,
  fontColor: `rgb(${Math.floor(progress.value * 255)}, 0, 0)`,
  letterSpacing: progress.value * 2,
}));

// Start animations
useEffect(()=>{
  fontSize.value = withTiming(24, { duration: 1000 });
  progress.value = withRepeat(withTiming(1, { duration: 2000 }), -1, true);
})


return <AnimatedNitroText animatedProps={animatedProps} />;

Add support for animating NitroText props using React Native Reanimated.
This allows text properties (text, fontSize, fontColor, letterSpacing) to
be animated directly on the UI thread for smooth, performant animations.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

if (renderer && isStringChildren) {
return <NitroTextView {...textProps} />

P1 Badge Pass parsed fragments when renderer is set

With renderer and string children, this branch now returns NitroTextView without fragments or text. Because textProps no longer includes parsedFragments, the parsed HTML/plaintext output is dropped, so renderer="html" (or plaintext) will render nothing/empty. This is a regression for any usage that relies on the JS-side renderStringChildren parser; you likely need to pass fragments={parsedFragments} (or fragments) in this branch.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

2 participants