Triage a Nativewind or react-native-css GitHub issue. Reads the issue, determines version/repo, creates a reproduction, tests against latest published and local HEAD, then drafts a comment.
You are triaging a GitHub issue for either nativewind/nativewind or nativewind/react-native-css. Your goal is to understand the issue, reproduce it, verify it against the latest releases and local HEAD, and draft a response.
Before diving in, read the relevant project docs for architecture and conventions:
CLAUDE.md and DEVELOPMENT.md in /Users/dan/Developer/nativewind/nativewind/CLAUDE.md and DEVELOPMENT.md in /Users/dan/Developer/nativewind/react-native-css/CONTRIBUTING.md and check test structure in /Users/dan/Developer/nativewind/nativewind-v4/These docs describe the architecture, test conventions, commands, and common pitfalls for each project. Use them to inform your reproduction strategy and root cause analysis.
Extract the issue number and repo from $ARGUMENTS. Accept formats like:
123 or #123 (defaults to nativewind/nativewind)nativewind/nativewind#123nativewind/react-native-css#123https://github.com/nativewind/react-native-css/issues/45gh issue view <number> --repo <owner/repo> --json title,body,labels,state,comments,createdAt,author
Read the full output carefully. Pay attention to:
nativewind/react-native-cssreact-native-css is a standalone CSS polyfill for React Native. It provides the CSS compiler (lightningcss-based), babel plugin (import rewriting), Metro transformer, and native runtime styling engine. It functions independently of Tailwind CSS but is the engine behind Nativewind v5. There is no v4 equivalent in this repo (v4's runtime was react-native-css-interop, which lives in the nativewind-v4 monorepo).
Read DEVELOPMENT.md in the react-native-css repo for the full architecture diagram and key directories. The issue likely involves one of these layers:
src/compiler/) if CSS parses/compiles incorrectlysrc/native/) if styles resolve incorrectly at runtimesrc/babel/) if import rewriting failssrc/metro/) if bundling/transformation fails| react-native-css | |
|---|---|
| Branch | main |
| npm package | react-native-css |
| npm tag | @latest |
| Local repo path | /Users/dan/Developer/nativewind/react-native-css |
nativewind/nativewindFigure out whether this is a v4 or v5 issue. Clues:
nativewind version in their package.json (v4.x = v4, v5.x = v5)tailwind.config.js = v4 (v5 uses Tailwind CSS v4's @tailwindcss/postcss)react-native-css-interop = v4; react-native-css = v5@import "nativewind/theme" = v5| Nativewind v4 (stable) | Nativewind v5 (preview) | |
|---|---|---|
| Branch | v4 | main |
| Tailwind | v3 | v4 |
| Runtime | react-native-css-interop | react-native-css |
| npm tag | @latest | @preview |
| Repro template | npx rn-new@latest --nativewind | npx rn-new@next --nativewind |
| Local repo path | /Users/dan/Developer/nativewind/nativewind-v4 | /Users/dan/Developer/nativewind/nativewind |
Before creating a reproduction, check if there is enough information:
If the issue lacks critical details needed for reproduction, skip to Step 6 and draft a comment requesting more information. Tailor the ask to the repo:
For nativewind issues:
Thanks for reporting this. To investigate, we need a minimal reproduction. Could you provide:
- Your
package.jsondependencies (nativewind, react-native-css/react-native-css-interop, tailwindcss versions)- The specific className(s) or config causing the issue
- A reproduction using
npx rn-new@latest --nativewind(v4) ornpx rn-new@next --nativewind(v5)
For react-native-css issues:
Thanks for reporting this. To investigate, we need a minimal reproduction. Could you provide:
- Your
react-native-cssversion- The CSS and component code that triggers the issue
- Expected vs. actual behavior
Create a minimal reproduction. The approach depends on the repo and what's being tested.
Tests are organized by domain in src/__tests__/ with three subdirectories: native/, compiler/, babel/. Before writing a test, read a few existing tests in the relevant subdirectory to match the conventions exactly.
For native styling issues (most common, e.g., wrong style output, className not working):
// Create: src/__tests__/native/triage-<issue-number>.test.tsx
import { render, screen } from "@testing-library/react-native";
import { View } from "react-native-css/components/View";
import { registerCSS, testID } from "react-native-css/jest";
describe("Issue #<number>", () => {
test("description of the problem", () => {
registerCSS(`.my-class { /* the CSS from the issue */ }`);
render(<View testID={testID} className="my-class" />);
const component = screen.getByTestId(testID);
// Log what we actually get
console.log(JSON.stringify(component.props, null, 2));
// Assert expected behavior
expect(component.props).toStrictEqual({
children: undefined,
style: { /* expected styles */ },
testID,
});
});
});
Run with: cd /Users/dan/Developer/nativewind/react-native-css && yarn test src/__tests__/native/triage-<issue-number>.test.tsx
For compiler issues (CSS parses wrong, wrong JSON output):
Read existing tests in src/__tests__/compiler/ (e.g., compiler.test.tsx, declarations.test.tsx) to match the pattern. Compiler tests verify the JSON output structure from compile().
Run with: cd /Users/dan/Developer/nativewind/react-native-css && yarn test compiler
For babel issues (import rewriting broken):
Read existing tests in src/__tests__/babel/ which use babel-plugin-tester.
Run with: cd /Users/dan/Developer/nativewind/react-native-css && yarn test babel
For runtime issues that need a full app:
cd /Users/dan/Developer/nativewind/react-native-css/example
yarn example start:build # Rebuilds library + starts Metro
For CSS/styling issues (in /Users/dan/Developer/nativewind/nativewind):
// Create: src/__tests__/triage-<issue-number>.test.ts
import { renderCurrentTest, renderSimple } from "../test-utils";
describe("Issue #<number>", () => {
test("<the-failing-classname>", async () => {
// Use renderCurrentTest() if testing a single className (test name = className)
const result = await renderCurrentTest();
console.log(JSON.stringify(result, null, 2));
});
// Or use renderSimple() for more complex scenarios
test("complex case", async () => {
const result = await renderSimple({
className: "<multiple classes here>",
// css: "custom CSS if needed",
// extraCss: "additional CSS",
});
console.log(JSON.stringify(result, null, 2));
});
});
Run with: yarn test src/__tests__/triage-<issue-number>.test.ts
(in /Users/dan/Developer/nativewind/nativewind-v4):
Check the v4 test conventions first:
ls /Users/dan/Developer/nativewind/nativewind-v4/packages/nativewind/src/__tests__/
Then write a similar test following v4's patterns.
These are harder to reproduce with unit tests. Create a standalone project:
v5 / react-native-css: npx rn-new@next --nativewind in a temp directory
v4: npx rn-new@latest --nativewind in a temp directory
Then replicate the reporter's setup and config.
Run the reproduction in two contexts:
For test-based reproductions, this is what yarn test already does (uses installed dependencies).
For app-based reproductions, ensure the project uses the latest published version:
react-native-css@latestnativewind@latestnativewind@previewRecord the result: does the issue reproduce? What's the actual vs. expected behavior?
For test-based reproductions in the repo itself, the tests already run against local source.
But consider whether the bug crosses repo boundaries:
react-native-css compiler bug@map variantCheck recent commits for relevant changes:
# In the appropriate repo
git log --oneline -20
If the issue might be in a different repo than where it was filed, note that in your findings.
Based on your findings, draft a GitHub issue comment. The tone should be helpful and direct. Include:
If the issue is not reproducible, say so clearly and ask for more details.
If the issue is already fixed on HEAD but not published, mention that and suggest the user try the latest version or a canary build.
Format the comment as a markdown blockquote so Dan can review it before posting:
Reproduction result
[Your findings here]
Remove any temporary test files you created:
# In whichever repo you created the test
rm src/__tests__/triage-<issue-number>.test.ts
rm src/__tests__/native/triage-<issue-number>.test.tsx
rm src/__tests__/compiler/triage-<issue-number>.test.tsx
Do NOT leave triage test files in either repo.