1
0
Fork 0

chore: add typescript examples

This commit is contained in:
Clément Vannicatte 2022-06-24 11:45:48 +02:00
parent 8076389b51
commit 077db6b73c
9 changed files with 859 additions and 2287 deletions

View file

@ -13,6 +13,6 @@
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script src="src/index.js"></script>
<script type="module" src="src/index.tsx"></script>
</body>
</html>

View file

@ -15,6 +15,9 @@
"react-dom": "18.1.0"
},
"devDependencies": {
"parcel": "2.0.0-beta.2"
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"parcel": "2.6.0",
"typescript": "4.6.4"
}
}

View file

@ -3,5 +3,5 @@ import { createRoot } from 'react-dom/client';
import App from './App';
const root = createRoot(document.getElementById('root'));
const root = createRoot(document.getElementById('root')!);
root.render(<App />);

View file

@ -0,0 +1,3 @@
{
"extends": "../../tsconfig.json"
}

View file

@ -9,12 +9,12 @@
</head>
<body>
<div class="container">
<div class="container" id="app">
<h1>DocSearch v3 - Vanilla JavaScript</h1>
<div id="docsearch"></div>
</div>
<script src="app.js"></script>
<script type="module" src="app.ts"></script>
</body>
</html>

View file

@ -10,9 +10,10 @@
},
"dependencies": {
"@docsearch/css": "3.1.0",
"@docsearch/js": "3.1.0"
"@docsearch/js": "3.1.0",
"parcel": "2.6.0"
},
"devDependencies": {
"parcel": "2.0.0-beta.2"
"typescript": "4.6.4"
}
}

3125
yarn.lock

File diff suppressed because it is too large Load diff