Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export text evaluate function #3692

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

phelma
Copy link

@phelma phelma commented Oct 28, 2024

Description

We're overwriting the default Text component in order to add some functionality.

However by doing this we've lost the ability to use Custom data and Context in our text component ( inserting values into text fields like this: {{state.value}}.

By exporting the evaluate function we will be able to add this functionality into our custom text component.

@phelma phelma requested review from samijaber and a team as code owners October 28, 2024 15:43
Copy link

changeset-bot bot commented Oct 28, 2024

🦋 Changeset detected

Latest commit: 808b8d6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@builder.io/sdk Patch
@builder.io/react Patch
@builder.io/sdk-angular Patch
@builder.io/sdk-react-nextjs Patch
@builder.io/sdk-qwik Patch
@builder.io/sdk-react Patch
@builder.io/sdk-react-native Patch
@builder.io/sdk-solid Patch
@builder.io/sdk-svelte Patch
@builder.io/sdk-vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@samijaber
Copy link
Contributor

@phelma thanks for the PR!

While this would get the job done, I am hesitant to expose our evaluate logic as part of the SDK's API due to its inherent complexity and edge cases.

What we can do instead to unblock you is move the evaluate() logic that's inside of text.lite.tsx to run as part of the core SDK logic, so that anyone overriding Text will receive a pre-evaluated text property.

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