Repository navigation
test: read the Tailwind render helper's plugin option - #508
Open
YevheniiKotyrlo wants to merge 1 commit into
Open
YevheniiKotyrlo wants to merge 1 commit into
YevheniiKotyrlo wants to merge 1 commit into
Conversation
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
marked this pull request as ready for review
October 23, 2026 19:49
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
render()insrc/__tests__/vendor/tailwind/_tailwind.tsxdocuments apluginoption,@default true, but never reads it: the option falls through to Testing Library's render options, and every render importstailwindcss-safe-area, so a test that setsplugin: falsestill compiles with the plugin.Solution
render()readsplugin, defaulting totrue, and importstailwindcss-safe-areaonly 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.tsxgainspt-safe without the plugin, which renderspt-safewithplugin: falseand expects no style. Onmainit receivesstyle: { paddingTop: 10 }.Verification
yarn test src/__tests__/vendor/tailwind/safe-area.test.tsx(33 passed),yarn linton the two files andyarn typecheckpass.