Companion repo for a course hosted on Udemy.com
stephengrider / reactssrcasts Goto Github PK
View Code? Open in Web Editor NEWCompanion Repo to https://www.udemy.com/server-side-rendering-with-react-and-redux
Companion Repo to https://www.udemy.com/server-side-rendering-with-react-and-redux
ReactSSRCasts/server/build/bundle.js
Line 1 in 99f2814
i have this route
{
...PostPage,
path: '/post/:id'
}
how can i read :id props il server side ?
Please, I've watched the course, and deployed the system, but I need to include assets, I included style-loader, css-loader and tried to use in a component, if I use any import style 'style.css' for example, I get
ReferenceError: window is not defined
due to this line window.INITIAL_STATE = ${serialize(store.getState())}.
Hi!
Im trying to add the user id in the url..like /users/1
I put 'user/:id' router´s file but the problem is that when i call the component with props it render twice.
'const UserPanel = (props) => {'
at first render get de props.params.id { id: 1 }
next render get { id: 'bundle.js' }
Do you know what may be happening?
Thanks a lot! your courses are very clear...
Is there Any chance of implementing Hot module reloading for this?
Hi
please update all dev dependancy react and react dom webpack, babel
ReactSSRCasts/server/src/index.js
Line 52 in 99f2814
ReactSSRCasts/server/package.json
Line 19 in 99f2814
@StephenGrider Can you share on how to create a production build of the files
app.get('*', (req, res) => {
const store = createStore(req);
const promises = matchRoutes(Routes, req.path)
.map(({ route }) => {
return route.loadData ? route.loadData(store) : null;
})
.map(promise => {
if (promise) {
return new Promise((resolve, reject) => {
promise.then(resolve).catch(resolve);
});
}
});
Promise.all(promises).then(() => {
const context = {};
const content = renderer(req, store, context);
if (context.url) {
return res.redirect(301, context.url);
}
if (context.notFound) {
res.status(404);
}
res.send(content);
});
});
Looking at this part of code in index.js, this method is bind to every get request.
Does it mean there is a lot of overhead when user navigates frequently between screens?
Same issue raised here: https://www.udemy.com/server-side-rendering-with-react-and-redux/learn/v4/questions/4896838
Lesson 69 "Header Customization": I'm trying to login with google, but keep getting the same error: redirect_uri_mismatch.(status code: 400). I think it's because my localhost using "http:"
and query params:
redirect_uri: https://localhost:3000/api/auth/google/callback
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.