Skip to content

Commit

Permalink
experiment-2 check value inside useEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeou committed Mar 1, 2024
1 parent d8983b2 commit f2eeed8
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions demo/react/build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"files": {
"main.css": "/cess-js-sdk-frontend/static/css/main.e3db530d.css",
"main.js": "/cess-js-sdk-frontend/static/js/main.b452a9a4.js",
"main.js": "/cess-js-sdk-frontend/static/js/main.28e2eeb4.js",
"static/js/988.2bd7f8a9.chunk.js": "/cess-js-sdk-frontend/static/js/988.2bd7f8a9.chunk.js",
"index.html": "/cess-js-sdk-frontend/index.html",
"main.e3db530d.css.map": "/cess-js-sdk-frontend/static/css/main.e3db530d.css.map"
},
"entrypoints": [
"static/css/main.e3db530d.css",
"static/js/main.b452a9a4.js"
"static/js/main.28e2eeb4.js"
]
}
2 changes: 1 addition & 1 deletion demo/react/build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/cess-js-sdk-frontend/favicon.ico"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"><link rel="apple-touch-icon" href="/cess-js-sdk-frontend/logo192.png"/><link rel="manifest" href="/cess-js-sdk-frontend/manifest.json"/><script src="./webconfig.js" charset="utf-8"></script><script type="text/javascript">!function(n){if("/"===n.search[1]){var a=n.search.slice(1).split("&").map((function(n){return n.replace(/~and~/g,"&")})).join("?");window.history.replaceState(null,null,n.pathname.slice(0,-1)+a+n.hash)}}(window.location)</script><title>cess-js-sdk-frontend demo</title><script defer="defer" src="/cess-js-sdk-frontend/static/js/main.b452a9a4.js"></script><link href="/cess-js-sdk-frontend/static/css/main.e3db530d.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/cess-js-sdk-frontend/favicon.ico"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"><link rel="apple-touch-icon" href="/cess-js-sdk-frontend/logo192.png"/><link rel="manifest" href="/cess-js-sdk-frontend/manifest.json"/><script src="./webconfig.js" charset="utf-8"></script><script type="text/javascript">!function(n){if("/"===n.search[1]){var a=n.search.slice(1).split("&").map((function(n){return n.replace(/~and~/g,"&")})).join("?");window.history.replaceState(null,null,n.pathname.slice(0,-1)+a+n.hash)}}(window.location)</script><title>cess-js-sdk-frontend demo</title><script defer="defer" src="/cess-js-sdk-frontend/static/js/main.28e2eeb4.js"></script><link href="/cess-js-sdk-frontend/static/css/main.e3db530d.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

Large diffs are not rendered by default.

Binary file added demo/react/build/static/js/main.28e2eeb4.js.gz
Binary file not shown.
Binary file removed demo/react/build/static/js/main.b452a9a4.js.gz
Binary file not shown.
3 changes: 2 additions & 1 deletion demo/react/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ function App() {
let p = window.location.pathname;
if (p == lastCurr) return;
lastCurr = p;
let curr_key = p.replace("/cess-js-sdk-frontend", "");
console.log("useEffect: ", lastCurr);
setCurrent(lastCurr);
setCurrent(curr_key);
}, 300);
}, []);

Expand Down

0 comments on commit f2eeed8

Please sign in to comment.