ReactJS meetup - avril 2019
A NextJS implementation of the themoviedb.org website
Through feedback on actual project:
Looks like a regular SPA ...
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="text/javascript" src="./static/js/main.efc8b8c5.js"></script>
</body>
DEMO 📺
Why ?
DEMO 📺
styled-jsx
styled-components
sheet.collectStyles(<App {...props} />)
./pages
/a
to ./pages/a.tsx
Express based
Fully customizable
Constraints:
"Route masking"
Server-side
/movie/11
➡️ /movie?id=11
"Route masking"
Client-side
<Link href="/movie?id=11" as="/movie/11-star-wars" />
href
:./pages
as
: url to displayMaintains router state via push/replaceState
(or can even be used as an anchor)
"Route masking"
// server side
server.get('/movie/:id', (req, res) => {
return app.render(req, res, '/movie', {
id: req.params.id
})
})
// client side
<Link href="/movie?id=11" as="/movie/11" />
DEMO 📺
<meta>
/ <link>
tags📝 README