Skip to content

Conversation

@rayan1810
Copy link

This addresses the issue #4351 by adding a React Context with Text Component and checks + reads the parent Text's context to get it's style and merges it with the current Text's style, just like how React Native behaves.

Related issue

#4351

Test plan

Testing is pending, the PR is still a Work in progress!

@callstack-bot
Copy link

callstack-bot commented Mar 23, 2024

Hey @rayan1810, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

@rayan1810 rayan1810 changed the title WIP: Fix nested text styling not inheriting from parent Fix nested text styling not inheriting from parent Jul 13, 2024
@rayan1810
Copy link
Author

Ready for Review ✅

@rayan1810 rayan1810 changed the title Fix nested text styling not inheriting from parent fix: nested text styling not inheriting from parent Jul 13, 2024
@lukewalczak lukewalczak force-pushed the main branch 6 times, most recently from 1062366 to 1da5d15 Compare May 8, 2025 09:47
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

children.type === AnimatedText ||
children.type === StyledText)
) {
const { props } = rest.children as {
Copy link

Choose a reason for hiding this comment

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

Bug: Undefined children in Props Destructuring

Line 110 incorrectly references rest.children when attempting to extract props. Since children was destructured from the component's props, rest.children is undefined, leading to an issue when accessing its properties.

Fix in Cursor Fix in Web

>
{children}
</NativeText>
</TextContext.Provider>
Copy link

Choose a reason for hiding this comment

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

Bug: Text Context Missing in V3 Theme Variants

The TextContext.Provider is only present in the else branch, not in the theme.isV3 variant branch. This inconsistency prevents nested Text components from inheriting parent styles when using V3 themes with variants.

Fix in Cursor Fix in Web

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