react-native-tauri 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +9 -5
  2. package/package.json +3 -2
  3. package/.gitignore +0 -49
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
- import { createRoot } from 'react-dom/client'
3
- import App from '../App'
2
+ import ReactDOM from 'react-dom'
3
+ import App from '../../App'
4
4
 
5
5
  const rootElement = document.getElementById('root')
6
6
 
@@ -8,13 +8,17 @@ console.log('Document ready, root element:', rootElement)
8
8
 
9
9
  if (rootElement) {
10
10
  try {
11
- createRoot(rootElement).render(<App />)
11
+ if (ReactDOM.createRoot) {
12
+ ReactDOM.createRoot(rootElement).render(<App />)
13
+ } else if (ReactDOM.render) {
14
+ ReactDOM.render(<App />, rootElement)
15
+ } else {
16
+ throw new Error('No render method in ReactDOM')
17
+ }
12
18
  console.log('App rendered successfully')
13
19
  } catch (error) {
14
20
  console.error('Error rendering app:', error)
15
- rootElement.innerHTML = `<div style="color: red; padding: 20px; font-family: monospace; white-space: pre-wrap;">Error: ${error.message}\n${error.stack}</div>`
16
21
  }
17
22
  } else {
18
23
  console.error('Root element not found')
19
- document.body.innerHTML = '<div style="color: red; padding: 20px; font-family: monospace;">Root element not found</div>'
20
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tauri",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "A modern JavaScript/TypeScript module that integrates React Native with Tauri for building cross-platform desktop applications",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -35,7 +35,8 @@
35
35
  "build": "vite build",
36
36
  "preview": "vite preview",
37
37
  "tauri:dev": "tauri dev",
38
- "tauri:build": "tauri build"
38
+ "tauri:build": "tauri build",
39
+ "postinstall": "npm install"
39
40
  },
40
41
  "files": [
41
42
  "index.js",
package/.gitignore DELETED
@@ -1,49 +0,0 @@
1
- # Dependencies
2
- node_modules/
3
- package-lock.json
4
- yarn.lock
5
- pnpm-lock.yaml
6
-
7
- # Build outputs
8
- dist/
9
- build/
10
- *.tsbuildinfo
11
-
12
- # Vite
13
- .vite/
14
-
15
- # Environment variables
16
- .env
17
- .env.local
18
- .env.*.local
19
-
20
- # IDE
21
- .vscode/
22
- .idea/
23
- *.swp
24
- *.swo
25
- *~
26
- .DS_Store
27
- *.sublime-project
28
- *.sublime-workspace
29
-
30
- # OS
31
- Thumbs.db
32
- .DS_Store
33
-
34
- # Logs
35
- npm-debug.log*
36
- yarn-debug.log*
37
- yarn-error.log*
38
- lerna-debug.log*
39
- .pnpm-debug.log*
40
-
41
- # Coverage
42
- coverage/
43
- .nyc_output/
44
-
45
- # Testing
46
- .mocha-result.json
47
-
48
- # Tauri
49
- src-tauri/target/