init
This commit is contained in:
32
packages/host/src/App.tsx
Normal file
32
packages/host/src/App.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import React, { useEffect } from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import Counter from 'remote/Counter'
|
||||
import './index.css'
|
||||
import { Counter as CounterComponentType } from 'shared-types'
|
||||
import SvelteCounter from 'remoteSvelte/Counter'
|
||||
import { StoreProvider } from 'store/store'
|
||||
|
||||
const CounterComp = Counter as CounterComponentType
|
||||
|
||||
const App = () => {
|
||||
useEffect(() => {
|
||||
new SvelteCounter({
|
||||
target: document.getElementById('svelteApp'),
|
||||
})
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="container">
|
||||
<CounterComp initialValue={2} />
|
||||
|
||||
<div id={'svelteApp'}></div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
<StoreProvider>
|
||||
<App />
|
||||
</StoreProvider>,
|
||||
document.getElementById('app'),
|
||||
)
|
||||
10
packages/host/src/index.css
Normal file
10
packages/host/src/index.css
Normal file
@@ -0,0 +1,10 @@
|
||||
body {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
.container {
|
||||
font-size: 3rem;
|
||||
margin: auto;
|
||||
max-width: 800px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
15
packages/host/src/index.html
Normal file
15
packages/host/src/index.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>host</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
3
packages/host/src/index.ts
Normal file
3
packages/host/src/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import("./App");
|
||||
|
||||
export {};
|
||||
2
packages/host/src/remote.d.ts
vendored
Normal file
2
packages/host/src/remote.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
declare module "remote/Counter";
|
||||
declare module "remoteSvelte/Counter";
|
||||
Reference in New Issue
Block a user