Skip to content

fix: nativewind theme functions on web - #1346

Open
sjwall wants to merge 1 commit into
nativewind:v4from
sjwall:fix/platform-select-web
Open

fix: nativewind theme functions on web#1346
sjwall wants to merge 1 commit into
nativewind:v4from
sjwall:fix/platform-select-web

Conversation

@sjwall

@sjwall sjwall commented Nov 25, 2024

Copy link
Copy Markdown
Contributor

Fixes #1160 and #1179

The platformSelect function when running on web is using the native version when NATIVEWIND_OS is set to web.

Using the #1160 example repo

Putting a console.log(process.env.NATIVEWIND_OS) in tailwind config is always printing undefined when building for web.
But logging to a file instead results in web being printed:

if (process.env.NATIVEWIND_OS !== undefined) {
  writeFileSync(file, process.env.NATIVEWIND_OS);
}

I tried adding test cases but couldn't get the NATIVEWIND_OS environment variable to be set to undefined in the test case.

@vercel

vercel Bot commented Nov 25, 2024

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nativewind ✅ Ready (Inspect) Visit Preview Nov 25, 2024 11:48am

@sjwall

sjwall commented Dec 5, 2024

Copy link
Copy Markdown
Contributor Author

Hey @marklawlor are you able to look at reviewing this please?

@danstepanov

Copy link
Copy Markdown
Member

I'll play around with this over the weekend and follow up

@danstepanov danstepanov self-assigned this Mar 1, 2025
@sjwall

sjwall commented Mar 10, 2025

Copy link
Copy Markdown
Contributor Author

How did you get on with the change?

@danstepanov

Copy link
Copy Markdown
Member

I'll take a look at this PR tomorrow

@danstepanov

Copy link
Copy Markdown
Member

@marklawlor mind taking a look at this?

@danstepanov

Copy link
Copy Markdown
Member

Thanks for the contribution! The main branch has been rewritten for Nativewind v5, so this PR can't merge as-is. However, the underlying fix is still relevant to v4 (the current stable release).

If you're still interested, retarget this to the v4 branch and it should apply cleanly since the file paths are the same. Otherwise, no worries and we'll pick it up ourselves.

@danstepanov danstepanov added question Further information is requested v4 Issue pertains to version 4 labels Apr 9, 2026
@sjwall
sjwall changed the base branch from main to v4 April 9, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport to v4 question Further information is requested v4 Issue pertains to version 4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

platformSelect not working in v4

3 participants