Skip to content

test: read the Tailwind render helper's plugin option - #508

Open
YevheniiKotyrlo wants to merge 1 commit into
nativewind:mainfrom
YevheniiKotyrlo:fix/tailwind-render-plugin-option
Open

YevheniiKotyrlo wants to merge 1 commit into
nativewind:mainfrom
YevheniiKotyrlo:fix/tailwind-render-plugin-option

Conversation

@YevheniiKotyrlo

Copy link
Copy Markdown
Contributor

Problem

render() in src/__tests__/vendor/tailwind/_tailwind.tsx documents a plugin option, @default true, but never reads it: the option falls through to Testing Library's render options, and every render imports tailwindcss-safe-area, so a test that sets plugin: false still compiles with the plugin.

Solution

render() reads plugin, defaulting to true, and imports tailwindcss-safe-area only when it is on, as nativewind's copy of this helper gates its own plugin. With the option on, the generated CSS is unchanged. The option's comment now names the plugin.

Tests

safe-area.test.tsx gains pt-safe without the plugin, which renders pt-safe with plugin: false and expects no style. On main it receives style: { paddingTop: 10 }.

Verification

yarn test src/__tests__/vendor/tailwind/safe-area.test.tsx (33 passed), yarn lint on the two files and yarn typecheck pass.

render() documented a plugin option, on by default, but never read it,
so every render imported tailwindcss-safe-area. It now reads the option
and imports the plugin only when it is on.
@YevheniiKotyrlo
YevheniiKotyrlo marked this pull request as ready for review October 23, 2026 19:49

This branch has not been deployed

No deployments
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.

1 participant