File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636 "start" : " snowpack dev" ,
3737 "test" : " jest"
3838 },
39+ "dependencies" : {
40+ "react" : " ^17.0.1" ,
41+ "react-dom" : " ^17.0.1"
42+ },
3943 "devDependencies" : {
4044 "@glennsl/bs-jest" : " ^0.6.0" ,
41- "@snowpack/app-scripts-react" : " ^1.12.6" ,
45+ "@snowpack/plugin-dotenv" : " ^2.0.5" ,
46+ "@snowpack/plugin-react-refresh" : " ^2.3.9" ,
4247 "@snowpack/plugin-run-script" : " ^2.2.1" ,
43- "@testing-library/jest-dom" : " ^5.11.5 " ,
48+ "@testing-library/jest-dom" : " ^5.11.8 " ,
4449 "@testing-library/react" : " ^11.1.1" ,
4550 "bs-platform" : " ^8.4.2" ,
4651 "bs-react-testing-library" : " ^0.8.0" ,
4752 "jest" : " ^26.6.3" ,
48- "react" : " ^17.0.1" ,
49- "react-dom" : " ^17.0.1" ,
5053 "reason-react" : " ^0.9.1" ,
5154 "snowpack" : " ^2.18.5"
5255 }
Original file line number Diff line number Diff line change 1010 < body >
1111 < div id ="root "> </ div >
1212 < noscript > You need to enable JavaScript to run this app.</ noscript >
13- < script type ="module " src ="/_dist_ /index.bs.js "> </ script >
13+ < script type ="module " src ="/dist /index.bs.js "> </ script >
1414 <!--
1515 This HTML file is a template.
1616 If you open it directly in the browser, you will see an empty page.
Original file line number Diff line number Diff line change 1+ /** @type {import("snowpack").SnowpackUserConfig } */
12module . exports = {
2- extends : '@snowpack/app-scripts-react' ,
3+ mount : {
4+ public : { url : '/' , static : true } ,
5+ src : { url : '/dist' } ,
6+ } ,
37 plugins : [
8+ '@snowpack/plugin-react-refresh' ,
9+ '@snowpack/plugin-dotenv' ,
410 [
511 '@snowpack/plugin-run-script' ,
612 {
713 cmd : 'bsb -make-world' ,
814 watch : '$1 -w' ,
915 } ,
10- ] ,
16+ ]
1117 ] ,
18+ install : [
19+ /* ... */
20+ ] ,
21+ installOptions : {
22+ /* ... */
23+ } ,
24+ devOptions : {
25+ /* ... */
26+ } ,
27+ buildOptions : {
28+ /* ... */
29+ } ,
30+ alias : {
31+ /* ... */
32+ } ,
1233} ;
Original file line number Diff line number Diff line change 44
55@react.component
66let make = () => {
7- let (count , setCount ) = React .useState (() => 0 )
7+ let (count , setCount ) = React .useState (() => 0 . )
88
99 React .useEffect0 (() => {
10- let intervalId = Js .Global .setInterval (() => setCount (count => count + 1 ), 1000 )
10+ let intervalId = Js .Global .setInterval (() => setCount (count => count +. 1 .), 100 )
11+
1112 Some (() => Js .Global .clearInterval (intervalId ))
1213 })
1314
@@ -21,8 +22,8 @@ let make = () => {
2122 </p >
2223 <p >
2324 {React .string ("Page has been open for " )}
24- <code > {React .int ( count )} </code >
25- {React .string (" seconds. " )}
25+ <code > {React .string ( Printf . sprintf ( "%.1f" , count /. 10 .) )} </code >
26+ {React .string (" seconds" )}
2627 </p >
2728 <a className = "App-link" href = "https://reactjs.org" target = "_blank" rel = "noopener noreferrer" >
2829 {React .string ("Learn React" )}
Original file line number Diff line number Diff line change 1- %%raw (` import ' ./index.css' ;` )
2-
3- ReactDOMRe .renderToElementWithId (<App />, "root" )
4-
51// Hot Module Replacement (HMR) - Remove this snippet to remove HMR.
62// Learn more: https://www.snowpack.dev/#hot-module-replacement
73@scope(("import", "meta")) @val external hot: bool = "hot"
84
95@scope(("import", "meta", "hot")) @val
106external accept: unit => unit = "accept"
117
8+ %%raw(`import './index.css';`)
9+
10+ ReactDOMRe.renderToElementWithId(<React .StrictMode> <App /> </React .StrictMode>, "root")
11+
1212if hot {
1313 accept()
1414}
You can’t perform that action at this time.
0 commit comments