create-near-app 5.3.0-beta.1 → 5.3.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-near-app",
3
- "version": "5.3.0-beta.1",
3
+ "version": "5.3.0",
4
4
  "description": "Quickly scaffold your dApp on NEAR Blockchain",
5
5
  "main": "index.js",
6
6
  "engines": {
@@ -1,6 +1,5 @@
1
1
  // React
2
- import React from 'react';
3
- import ReactDOM from 'react-dom';
2
+ import { createRoot } from 'react-dom/client';
4
3
  import App from './App';
5
4
 
6
5
  // NEAR
@@ -11,13 +10,14 @@ const CONTRACT_ADDRESS = process.env.CONTRACT_NAME
11
10
  // When creating the wallet you can optionally ask to create an access key
12
11
  // Having the key enables to call non-payable methods without interrupting the user to sign
13
12
  const wallet = new Wallet({ createAccessKeyFor: CONTRACT_ADDRESS })
13
+ const container = document.getElementById('root');
14
+ const root = createRoot(container); // createRoot(container!) if you use TypeScript
14
15
 
15
16
  // Setup on page load
16
17
  window.onload = async () => {
17
18
  const isSignedIn = await wallet.startUp()
18
-
19
- ReactDOM.render(
20
- <App isSignedIn={isSignedIn} contractId={CONTRACT_ADDRESS} wallet={wallet} />,
21
- document.getElementById('root')
19
+
20
+ root.render(
21
+ <App isSignedIn={isSignedIn} contractId={CONTRACT_ADDRESS} wallet={wallet} />
22
22
  );
23
23
  }