Skip to content

Commit e9ee102

Browse files
committed
Synchornize example code with latest app-template-react
1 parent 0620714 commit e9ee102

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ See the section about running tests for more information.
3131

3232
### npm run build
3333

34-
Builds a static copy of yor site to the `build/` folder.
34+
Builds a static copy of your site to the `build/` folder.
3535
Your app is ready to be deployed!
3636

3737
**For the best production performance:** Add a build bundler plugin like "@snowpack/plugin-webpack" or "@snowpack/plugin-parcel" to your `snowpack.config.json` config file.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
},
3939
"devDependencies": {
4040
"@glennsl/bs-jest": "^0.5.1",
41-
"@snowpack/app-scripts-react": "^1.10.0",
42-
"@snowpack/plugin-run-script": "^2.1.2",
41+
"@snowpack/app-scripts-react": "^1.12.0",
42+
"@snowpack/plugin-run-script": "^2.1.3",
4343
"@testing-library/jest-dom": "^5.11.4",
4444
"@testing-library/react": "^11.0.4",
4545
"bs-platform": "^8.2.0",
@@ -48,6 +48,6 @@
4848
"react": "^16.13.1",
4949
"react-dom": "^16.13.1",
5050
"reason-react": "^0.9.1",
51-
"snowpack": "^2.11.1"
51+
"snowpack": "^2.13.1"
5252
}
5353
}

src/App.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
.App {
22
text-align: center;
33
}
4-
4+
.App code {
5+
background: #FFF3;
6+
padding: 4px 8px;
7+
border-radius: 4px;
8+
}
9+
.App p {
10+
margin: 0.4rem;
11+
}
512
.App-logo {
613
height: 40vmin;
714
pointer-events: none;

src/App.res

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
%%raw(`import './App.css';`)
44

55
@react.component
6-
let make = () =>
6+
let make = () => {
7+
let (count, setCount) = React.useState(() => 0)
8+
9+
React.useEffect0(() => {
10+
let intervalId = Js.Global.setInterval(() => setCount(count => count + 1), 1000)
11+
Some(() => Js.Global.clearInterval(intervalId))
12+
})
13+
714
<div className="App">
815
<header className="App-header">
916
<img src=logo className="App-logo" alt="logo" />
@@ -12,8 +19,14 @@ let make = () =>
1219
<code> {React.string("src/App.jsx")} </code>
1320
{React.string(" and save to reload.")}
1421
</p>
22+
<p>
23+
{React.string("Page has been open for ")}
24+
<code> {React.int(count)} </code>
25+
{React.string(" seconds.")}
26+
</p>
1527
<a className="App-link" href="https://reactjs.org" target="_blank" rel="noopener noreferrer">
1628
{React.string("Learn React")}
1729
</a>
1830
</header>
1931
</div>
32+
}

0 commit comments

Comments
 (0)