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

Add sx utility function #278

Closed
wants to merge 1 commit into from
Closed

Add sx utility function #278

wants to merge 1 commit into from

Conversation

doong-jo
Copy link
Contributor

@doong-jo doong-jo commented Feb 24, 2024

iShot_2024-02-24_17 15 04

This is a utility that proves to be useful when wanting to merge internal and external styles within a component. I've been actively using the sx function in my current project, finding it immensely helpful. Hence, I thought it would be a beneficial addition to twnrc.

Currently, we need to receive className as a string and pass it as an argument to tw.style. However, this approach requires developers to manually add the className prop, which can be cumbersome.

sx, on the other hand, mitigates this effort by accepting RN's StyleProp as the second parameter, simplifying the process of passing styles.

@jaredh159
Copy link
Owner

Thanks for the contribution!

However, this approach requires developers to manually add the className prop, which can be cumbersome.

I'm confused by what you're describing here. twrnc doesn't use a className prop at all, since that's not a prop on RN components.

And I guess overall, I'm having trouble grokking which pain point this solves, or exactly what value this function is providing. Could you give me some examples of code samples without sx that are awkward or unergonomic, that sx improves?

@doong-jo
Copy link
Contributor Author

As time goes by, this seems to have something to do with my code style. I don't think it's a necessary change for this repository, so I'll close it. Thanks to your reply

@doong-jo doong-jo closed this Apr 10, 2024
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