React can do both!
const React = require('react');
const ReactDOM = require('react-dom');
ReactDOM.render(<App />, document.getElementById('app'));
const React = require('react');
const { renderToString } = require('react-dom/server')
renderToString(<App />)
// result must be inserted into target div
GET - /
SERVER
<!DOCTYPE html>
<html>
<head>
<title>Pup vs Pup</title>
<link rel="stylesheet" href="/css/style.css">
<script src="public/bundle.js" defer></script>
</head>
<body>
<div id="app"></div>
</body>
</html>
index.html
CLIENT SIDE
SERVER SIDE
DISCUSSION
DEMO
User View
CLIENT SIDE
SERVER SIDE
DISCUSSION
DEMO
CLIENT SIDE
SERVER SIDE
DISCUSSION
DEMO
GET - /
SERVER
GET - /bundle.js
React.DOM Render
React.DOM Render
GET - api/puppies
GET - /style.css
index.html
waiting...
waiting...
GET - /img
CLIENT SIDE
SERVER SIDE
DISCUSSION
DEMO
GET - /
SERVER
React.DOM Render
GET - /bundle.js
GET - /style.css
GET - /img
waiting...
Add Event Listeners, checks state
CLIENT SIDE
SERVER SIDE
DISCUSSION
DEMO
class="no-js edition-domestic app-homepage"
CLIENT SIDE
SERVER SIDE
DISCUSSION
DEMO
CLIENT SIDE
SERVER SIDE
DISCUSSION
DEMO