Skip to content

Commit 26b272f

Browse files
authored
fix: metro not injecting styles (#76)
1 parent 2b31157 commit 26b272f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/metro/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import connect from "connect";
66
import debug from "debug";
77
import type { MetroConfig } from "metro-config";
88

9-
import type { CompilerOptions } from "../compiler";
9+
import type { CompilerOptions, ReactNativeCssStyleSheet_V2 } from "../compiler";
1010
import { compile } from "../compiler/compiler";
1111
import { getNativeInjectionCode, getWebInjectionCode } from "./injection-code";
1212
import { nativeResolver, webResolver } from "./resolver";
@@ -93,7 +93,10 @@ export function withReactNativeCSS<
9393
if (!bundler.__react_native_css__patched) {
9494
bundler.__react_native_css__patched = true;
9595

96-
const nativeCSSFiles = new Map();
96+
const nativeCSSFiles = new Map<
97+
string,
98+
[string, ReactNativeCssStyleSheet_V2]
99+
>();
97100
const webCSSFiles = new Set<string>();
98101

99102
const nativeInjectionPath = require.resolve(
@@ -174,7 +177,7 @@ export function withReactNativeCSS<
174177
next,
175178
compile(next, {
176179
hexColors: options?.hexColors,
177-
}),
180+
}).stylesheet(),
178181
]);
179182

180183
watcher.emit("change", {

0 commit comments

Comments
 (0)