mirror of
https://github.com/zoriya/vite-rnw-ssr-repro.git
synced 2025-12-05 22:56:11 +00:00
Fix import issue, now hook issue shows
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useState } from 'react';
|
||||
import reactLogo from './assets/react.svg';
|
||||
import { Text } from 'react-native';
|
||||
import { View } from 'react-native';
|
||||
import './App.css';
|
||||
|
||||
function App() {
|
||||
@@ -17,14 +17,14 @@ function App() {
|
||||
</a>
|
||||
</div>
|
||||
<h1>Vite + React</h1>
|
||||
<div className="card">
|
||||
<View className="card">
|
||||
<button onClick={() => setCount((count) => count + 1)}>
|
||||
count is {count}
|
||||
</button>
|
||||
<p>
|
||||
Edit <code>src/App.jsx</code> and save to test HMR
|
||||
</p>
|
||||
</div>
|
||||
</View>
|
||||
<p className="read-the-docs">
|
||||
Click on the Vite and React logos to learn more
|
||||
</p>
|
||||
|
||||
@@ -9,10 +9,12 @@ export default defineConfig({
|
||||
react(),
|
||||
reactNative(),
|
||||
cjsInterop({
|
||||
dependencies: [
|
||||
"inline-style-prefixer",
|
||||
"inline-style-prefixer/**",
|
||||
],
|
||||
dependencies: ["inline-style-prefixer", "inline-style-prefixer/**"],
|
||||
}),
|
||||
],
|
||||
ssr: {
|
||||
optimizeDeps: {
|
||||
include: ["react-native-web"],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user