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

Use .native.tsx instead of .web.tsx #579

Open
nandorojo opened this issue Dec 11, 2024 · 4 comments · May be fixed by #582
Open

Use .native.tsx instead of .web.tsx #579

nandorojo opened this issue Dec 11, 2024 · 4 comments · May be fixed by #582
Labels
enhancement New feature or request

Comments

@nandorojo
Copy link
Contributor

React web apps don't use the .web.tsx pattern. However, all native apps do use platform extensions.

I'd propose changing MarkdownTextInput.tsx to have the web code, and MarkdownTextInput.tsx to have the React Native code. This way, Web developers don't need additional config to install the library.

I'm happy to do this in a PR if you'd merge it.

@nandorojo
Copy link
Contributor Author

nandorojo commented Dec 11, 2024

Further: we should remove the usage of StyleSheet.create in the web file. Creating the style, and then subsequently flattening it, is unnecessarily expensive with React Native Web. It's better to just use an object and pass it to a flat style prop.

This would also remove the dependency on react-native-web, making this far easier for Web developers to consume.

I've maintained so many RNW libraries, and I encourage you to avoid the headache of using it under the hood unless it's actually necessary

@tomekzaw
Copy link
Collaborator

@nandorojo Thanks for opening this issue. We're definitely open to such contribution, feel free to submit a PR.

Just one more thing – let's introduce .native.tsx suffix and remove .web.tsx suffix in one PR and then remove the usage of StyleSheet in another PR so we can keep the changes atomic.

@tomekzaw tomekzaw added the enhancement New feature or request label Dec 11, 2024
@nandorojo nandorojo linked a pull request Dec 11, 2024 that will close this issue
8 tasks
@nandorojo
Copy link
Contributor Author

PR opened here #582

@nandorojo
Copy link
Contributor Author

Just one more thing – let's introduce .native.tsx suffix and remove .web.tsx suffix in one PR and then remove the usage of StyleSheet in another PR so we can keep the changes atomic.

Damn it, just saw this lol. I'll revert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants