This is an example Pogo app with React client-side rendering.
Based on Simple Server, with the following changes:
- Added
index.html
, where the app will be rendered on the client - Added a
client
directory with frontend modules such asclient/app.jsx
- Added
client/counter.jsx
, a counter component that usesReact.useState
Make sure Deno is installed and up to date.
This example cannot be run remotely, because it reads certain files using the filesystem, such as index.html
and build/app.js
.
Alternatively, if you want to play around with the example, run it from a local file:
curl -fsSL https://github.com/sholladay/pogo/archive/master.tar.gz | tar -xz --strip-components=1 'pogo-master/example'
cd example/react-on-client
mkdir -p build
deno bundle client/app.jsx build/app.js
deno run --allow-net --allow-read run.ts
Visit http://localhost:3000/