React Server Side Rendering Introduction For Beginners - ReactJS ssr with Expressjs

Поделиться
HTML-код
  • Опубликовано: 24 дек 2024

Комментарии • 260

  • @HarshSingh-hk8fe
    @HarshSingh-hk8fe 2 года назад +19

    this is the most straightforward to the point tutorial i've ever seen just amazing bro

  • @obednuertey6162
    @obednuertey6162 Год назад

    Gone are the days we have to use two different servers for the same application. This is so so super simple. I usually don't subscribe after I watch a video. But your channel man, definitely is one any developer has to subscribe to

  • @gooddha
    @gooddha 4 года назад +11

    Хорошее видео, четко и по делу без лишней воды, шуток-прибауток и мычания!

    • @adhamahmed3300
      @adhamahmed3300 4 года назад

      exactly

    • @1001-w5q
      @1001-w5q 3 года назад

      @Snake ETH лично я дохуя чего не понял, но я ни разу не лез в бек, поэтому хз в ком проблема

  • @atg1203
    @atg1203 4 года назад +10

    Great video! You simplified it a lot compared to some of the other articles/videos I watched for React SSR.

  • @obednuertey6162
    @obednuertey6162 Год назад

    I am short of words man. It feels like dream come true.

  • @CoderDmitri
    @CoderDmitri 3 года назад

    I think I just learned THE DIM MAK on this page... thank you so much, you are LORD!

  • @mohamethseck
    @mohamethseck 4 года назад +5

    This video is perfect! Very simple and straight to the point.

  • @sanyokes
    @sanyokes 4 года назад +4

    Просто великолепно, начал сейчас учить реакт в связке MERN и мне очень важен SSR для СЕО, а тут все так понятно, спасибо за качественный контент)

    • @МаксВолков-э6и
      @МаксВолков-э6и 2 года назад

      А этот метод Вам помог? Для меня тоже очень важен ceo, а писать приложения на next js не особо хочется

    • @sanyokes
      @sanyokes 2 года назад

      @@МаксВолков-э6и Добрый вечер! Этот метод в итоге не пробовал, решил использовать Next.js, всё таки это более распространенное решение, много примеров как и что правильно делать

    • @МаксВолков-э6и
      @МаксВолков-э6и 2 года назад

      @@sanyokes Спасибо за ответ!

  • @yt-sh
    @yt-sh 5 месяцев назад

    This helped understand SSR better, thank you

  • @elite.topmotivation
    @elite.topmotivation 11 месяцев назад

    I got this to work on the all new "bun.js" runtime, no need for babel but I had to do some modifications. Good Tutorial, thanks

  • @janhorak7317
    @janhorak7317 4 года назад +2

    You are legend, thank you for explaining it in simple terms !

  • @joantonio6331
    @joantonio6331 5 лет назад +7

    For those who would wonder how to update the website after you edited the app, simple rebuild it then re run ssr

  • @charlievered3899
    @charlievered3899 2 года назад

    Thanks a lot for the explanation. I finally got it working!

  • @akhlakpatel921
    @akhlakpatel921 Год назад +1

    Thank you so much, bro, this video is very helpful for all, and your understanding way is ossom, thanks for sharing this, I request to one thing please can you make a video to CSR to SSR in vuejs, if you do please reply me, thanks a lot.

  • @prakharagrawal8983
    @prakharagrawal8983 Год назад

    Good and straight forward explaination

  • @nuyi9411
    @nuyi9411 4 года назад +10

    Simple code! Love it. Could you make a tutorial how to use it along with React-Helmet? Thanks!

  • @BlurryBit
    @BlurryBit 3 года назад

    Ok, this just demystified ssr for me. Thank you!!

  • @Arthur-ql5vg
    @Arthur-ql5vg 3 года назад

    Really straightforward explanations. Thanks a lot !

  • @iurysza
    @iurysza 4 года назад +2

    Loved the style, cheers mate!

  • @sergeyfilat4238
    @sergeyfilat4238 4 года назад

    Super! The best short explanation on youtube. Отлично! Побил даже учителей с Udemy.
    Немного суховато в конце. Было бы неплохо прогнать Клиентскую программу рядом с SSR и сравнить.

  • @yanifernandez6110
    @yanifernandez6110 3 года назад

    amazing man... its interesting and you are the smart guy..

  • @sayandcode
    @sayandcode 2 года назад

    Damn! Rare content, and very well done too!

  • @mohaimin13
    @mohaimin13 5 лет назад

    Thank you! This was very useful as a beginner.

  • @igniousprogrammerip3536
    @igniousprogrammerip3536 2 года назад

    Best video i just glad to know your channel

  • @devmike233
    @devmike233 4 года назад

    Hoped you explained more. Helpful video nonetheless.

  • @userfpdnbknsdbmfn
    @userfpdnbknsdbmfn 2 года назад +1

    It works fine but i have a little problem. My dotenv-package isn‘t working anymore after implemented react-ssr, do have someone a Tip for me to fix it?

  • @MichaelSalo
    @MichaelSalo 3 года назад +5

    This is great thank you. I see how this renders the HTML on server side. A question is why do we want to ignore styles?

    • @baraousseni1686
      @baraousseni1686 3 года назад

      If you watch the whole video, you'll see that inside his server/index.js file at the first line he uses require('ignore-styles'); which is used just to ignore the style

    • @winnerleparadoxe6496
      @winnerleparadoxe6496 2 года назад +1

      @@baraousseni1686 Yes but ignore the style?

  • @alexon2010
    @alexon2010 4 года назад +5

    Hello, friend I liked this approach for React SSR, it is very easy to understand, but I could normally use Redux, ReactRouter and Styled-Components, you would have a video that integrates these three points (Redux, ReactRouter and Styled-Components in React SSR)

    • @AjithKumarsham
      @AjithKumarsham 2 года назад

      +1

    • @vitorfigueiredomarques2004
      @vitorfigueiredomarques2004 2 года назад

      since ReactDom.hydrate simply makes the components from the client use the HTML generated from the server, it should integrate without any problem with other dependencies.

  • @09sangram
    @09sangram 4 года назад +5

    I am using react router and getting error when I am trying to run in SSR mode

  • @dominicsosnov
    @dominicsosnov 4 года назад +22

    Nice. It would be awesome and then I would subscribe if you took the time to explain why you do it this way. Maybe not every line, but for instance why replacing, why installing hydrate etc

  • @abdulsametsahin1604
    @abdulsametsahin1604 4 года назад

    Great and clean tutorial. Thank you 🙏

  • @arny699
    @arny699 8 месяцев назад

    Thank you for this tutorial. Its great! How to add meta tags into the head of the pre-rendered html file, if we replace only root div?

  • @ishandiablo
    @ishandiablo 5 лет назад

    Very helpful, thanks Maksim!

  • @sharkdeng9253
    @sharkdeng9253 7 месяцев назад +1

    good video. Can you have TypeScript version?

  • @laurenc180
    @laurenc180 3 года назад

    Great vid - what plugin are you using on VScode to import/tab to get snippets? Thanks!

  • @kinekt2000
    @kinekt2000 3 года назад +14

    какой классный тяжелый русский акцент, чувак ты ахуенен

  • @obednuertey6162
    @obednuertey6162 Год назад

    Man You are a Code God.😎. Thanks so so so much. But one more question. Do I need to build my create-react-app anytime I make changes to my Code?

  • @kalpittandon8999
    @kalpittandon8999 3 года назад +1

    @Maksim Ivanov How to put this code on production mode on hosting server because we are just putting build folder content on server how server/server.js read App component is this case?

    • @thatcoul
      @thatcoul 3 года назад

      That's what I'm wondering too, did you find the solution?

    • @kalpittandon8999
      @kalpittandon8999 3 года назад +1

      @@thatcoul we have to put all folders on to server. Like we setup on local as same we have to setup on other server like digital ocean node server etc.

    • @thatcoul
      @thatcoul 3 года назад

      @@kalpittandon8999 Thanks

    • @kalpittandon8999
      @kalpittandon8999 3 года назад

      @@thatcoul any time

  • @ahmadkhan-xn2nk
    @ahmadkhan-xn2nk 2 года назад

    sir showing error Warning: Expected server HTML to contain a matching in .

  • @Vasuchowdary
    @Vasuchowdary 3 года назад +1

    you look like theon greyjoy from game of thrones any way nice explanation

  • @NishantTilve
    @NishantTilve 4 года назад +1

    This was really straightforward and helpful. Thanks!

  • @MIHANIZM56
    @MIHANIZM56 5 лет назад +2

    по сути мы юзаем реакт как эдакий шаблонизатор. В случае с использованием React всё просто. Было бы круто увидеть сср с подключением Redux - там уже не всё так очевидно ))

    • @satansdeer1
      @satansdeer1  5 лет назад +1

      Да, можно watering редакс стора рассмотреть

  • @yuvrajagarkar8942
    @yuvrajagarkar8942 3 года назад

    loved it , have one question though , I'll still need to host both sever and react app separate right ?

  • @corndoggydogdog
    @corndoggydogdog 2 года назад

    Hi there, does this solution generate html on the serverside? It's not quite clear from the video if it does. Last question can it generate html for a specific component within the react app?

  • @vladia391
    @vladia391 2 года назад

    Hey dude, I don't get from where the build thing comes, can you explain? Like there is no build folder in the repo at all

  • @oleksii.shkulipa
    @oleksii.shkulipa 2 года назад

    thx very much for the tutorial. But what about navigation ? how can i produce SSR with many pages in react ? Thx

  • @eccheong
    @eccheong 2 года назад

    How do you configure your editor to be able to switch between navigating the cursor and typing?

  • @alexpineda1720
    @alexpineda1720 4 года назад

    your video is awesome, thanks a lot.

  • @prachigarg7161
    @prachigarg7161 2 года назад

    Will withRouter HOC from React-router-dom work in server side rendering as well?

  • @HeitorYT
    @HeitorYT Год назад

    Does it still works if i put it in a diferent directory after running npm run build?

  • @iliasvinin8718
    @iliasvinin8718 3 года назад

    Maksim you are Molotok! How do we deploy it? Usually I upload build content to server, but what should I do after your tutorial?

  • @jamiemcgrory1964
    @jamiemcgrory1964 4 года назад

    I was receiving an error when running `npm start` with this as hydrate could not match anything (the locally served files skip the express backend!).
    My fix has been to query the environment, i.e. if (process.env.NODE_ENV && process.env.NODE_ENV === 'production')
    Where true I am hydrating, where false I am rendering.
    To me this seems like a good way of keeping the benefits of the dev server (hot reload) whilst not impeding the built ssr behaviour, can you think of any drawbacks or alternatives?

  • @ceza121121
    @ceza121121 3 года назад

    Hi thanks for video but i have a issue like:
    ssr: `node server/index.js`
    problem with npm. There is likely additional logging output above.

  • @arturgorbunov3792
    @arturgorbunov3792 2 года назад +1

    Can you please explain how to create SSR with Routes ? Especially with Router-V6 &&

  • @haskell3702
    @haskell3702 2 года назад

    Do we only need use hydration on root?

  • @david-tracy
    @david-tracy 3 года назад

    Great. Thanks. What does ^/$ mean exactly?

  • @salmanjs2629
    @salmanjs2629 Год назад

    If i want to do server side rendering for specific components, is that possible?

  • @buddycake1009
    @buddycake1009 3 года назад

    You are a genius. Thank you

  • @anl6777
    @anl6777 Год назад

    You saved me! Thanks a lot

  • @DeepeshGidwani
    @DeepeshGidwani 2 года назад

    Maksim, how to resolve "ReferenceError: document is not defined" in this implementation ?

  • @parisanaderi1647
    @parisanaderi1647 2 года назад

    Does this method work on low version of react as v10 ?

  • @simongomes5671
    @simongomes5671 2 года назад

    I don't know how it will work for the content pages that we are fetching from APIs

  • @pokegaiyui
    @pokegaiyui 3 года назад

    Can you talk about why would someone go fully this route vs nextjs or gatsby?

  • @vittoriomorellini1939
    @vittoriomorellini1939 2 года назад

    Is it possible SSR with Next.js and .net 6 as the api?

  • @СергейСтрокатов-э4д

    Error: Cannot find module '/mnt/c/PROJECTS/right now/ssr-example/server/index.js'

  • @lenguajesdeprogramacionson5050
    @lenguajesdeprogramacionson5050 2 года назад

    I’m wondering how to deploy this set app

  • @naoumhaddad444
    @naoumhaddad444 4 года назад +1

    Hello, really nice video
    but how about pitfalls?
    There are many issues that cames with SSR
    and really annoying issues, it forces you run some packages on the server.
    how can I integrate SSR with React project that has a large code?
    and does it handy for SEO?
    how about alternates like pre-rendering?

    • @gogaiosebashvili9487
      @gogaiosebashvili9487 2 года назад

      hey, I know this comment is old, but I have same problem, I want to optimize my SEO, to make my meta images discoverable by Facebook crawlers, seems like I have only 2 options: SSR using express, or pre-render and I have no experience with neither of them. did you figure it out?

    • @bilalarain4632
      @bilalarain4632 Год назад

      @@gogaiosebashvili9487 hi haddad and goga, its good to see you also bumped ontu the same problem.
      so after reading your comment my innerself insisted to write, did you figured it out?

    • @ashprasad9075
      @ashprasad9075 Год назад

      Did you find any solution?

  • @bmsfx
    @bmsfx Год назад

    just crazy how much work is required to make this work, i have that you cant just take a already created page and say "this now react SSR" and then it works on your current code

  • @trendnowinind
    @trendnowinind 3 года назад

    Hi , The above code works well in the localhost port :8000 but not in production, how do we enable in production mode?

  • @prabdeepdhaliwal9725
    @prabdeepdhaliwal9725 4 года назад

    Very helpful, thank you!

  • @Lukex29
    @Lukex29 3 года назад

    Great video but do we know why webp image and svg files cause errors? these work ok with a create-react-app by default but using this your technique they are not processed by babel.. do I need to add something to server/index.js in the babel/register/presets?

  • @victornikliaiev466
    @victornikliaiev466 2 года назад

    Thank you! now I have an image how to use ReactDOMServer and ReactDOM.hydrate guy :D

  • @estudiantepromedio7722
    @estudiantepromedio7722 3 года назад

    thanks for all

  • @fitrianinasir5101
    @fitrianinasir5101 2 года назад

    great tutorial but your bottom right corner video layer often covered up the code😥

  • @tedo9425
    @tedo9425 2 года назад +1

    how can i use css with this tutorial?

  • @gladimirjacobsen6356
    @gladimirjacobsen6356 Год назад

    I got an error React not found when running the app. Could you guys help me please?

  • @raorobin0
    @raorobin0 4 года назад

    Support for the experimental syntax 'classProperties' isn't currently enabled , getting this error

  • @huynhdan8092
    @huynhdan8092 4 года назад +1

    Can redux and routing be used?

  • @yvesgonzaga4223
    @yvesgonzaga4223 4 года назад +1

    Can you give an example with using an API to get the data and render that data server side?

    • @cassette7440
      @cassette7440 4 года назад

      This's not working because i tried (Sorry if my english is bad)

  • @rakesh.rankawat
    @rakesh.rankawat 4 года назад

    Can you also suggest its deployment on Vercel?

  • @jamesperih9658
    @jamesperih9658 4 года назад

    Easiest SSR I've ever seen. I wonder if this is thanks to modern tooling; it seemed more difficult 3 years ago.

  • @reactstack257
    @reactstack257 3 года назад

    Is this indirect solve for SEO problem ?🤨

  • @fb_a
    @fb_a 4 года назад

    what if we use react routes? how will it know which page should be created initially?

  • @tarunteja28
    @tarunteja28 3 года назад

    Hi, I am getting an error saying React is not defined.
    How to solve this?

  • @debjitsinha1
    @debjitsinha1 4 года назад +1

    import logo from './logo.svg'
    the above is not working. Image is not being loaded into the browser. Could you please help me with this?

    • @zathkal4004
      @zathkal4004 4 года назад

      Simply delete both JSX tags mate along with the logo.svg file
      Then it should work (:

  • @mercenex6329
    @mercenex6329 4 года назад +1

    1st of all, thanks so much dude! This is really well explained and written, you've got a new sub that will share this to anyone learning React!
    2nd, I have a few issues porting an older project to this. Could the reason be npm?

    • @satansdeer1
      @satansdeer1  4 года назад +1

      MerceneX thanks, its hard to tell without seing the project, could you make an example repo with the reproduction of the issue you are having?

    • @mercenex6329
      @mercenex6329 4 года назад

      @@satansdeer1 Wow, that was lightning fast. Thanks for the response man!
      /questions/61227711/problems-migrating-react-to-ssr-import-extends-from-babel-runtime-helpers-es
      I've posted the above question on stackoverflow already. The github repo link is in there as well. If you're interested in discussing this further? :)
      And really, thank you again.

    • @satansdeer1
      @satansdeer1  4 года назад +2

      MerceneX I'll try to take a look later

    • @mercenex6329
      @mercenex6329 4 года назад

      @@satansdeer1 Thank you

    • @satansdeer1
      @satansdeer1  4 года назад +2

      @@mercenex6329 yo, i've checked your repo, I the scripts there don't seem to have `ssr` option. Am I looking in a wrong place, or is there something missing?

  • @SangNguyen-gq7wq
    @SangNguyen-gq7wq 3 года назад

    Error: Cannot find module 'app/theme'
    Require stack:
    - D:\F88Projects\WebPartner\src\App.js
    - D:\F88Projects\WebPartner\server\server.js
    - D:\F88Projects\WebPartner\server\index.js
    I get error when run ssr ??
    Please help me!

  • @shivammishra4477
    @shivammishra4477 3 года назад

    When m using Routers in my App.js after hitting localhost:8000 it's giving me an error Browser history needs a DOM

  • @akhlakpatel921
    @akhlakpatel921 Год назад

    That is working on local server, thanks for making it,
    but when we run npm run build, and then npm serve cmd to check dist folder is working or not, it giving me an error (Uncaught TypeError: n.createRoot(...).hydrate is not a function)
    please anyone help me

  • @harmonyc6734
    @harmonyc6734 4 года назад

    Hi wassup..
    Can I ask for help.. I've been following your video for SSR react to build a small app however I want to perform some authentication and save data to cookies and send them to the server as well.. and I'm failing to do that coz isomorphic fetch isn't working after I followed your steps to SSR.. can you help

  • @abeechr
    @abeechr 4 года назад

    Outstanding. Thank you.

  • @sagarsamtani2463
    @sagarsamtani2463 4 года назад

    Hi @Maksim Ivanov
    Really loved the video and implemented the same everything is working as expected.
    Yet I am facing one issue please let me know if it looks familiar you and any solution to it.
    In the network tab under preview we can see the html rendered but in my case I see blank page, so anything wrong here ?

  • @fahedbrahim39
    @fahedbrahim39 2 года назад

    perfect i love it, but how can i do it with react typescipt template !!! i have some problem

    • @melikekozan7711
      @melikekozan7711 2 года назад

      hi, actually i am finishing writing js but i have some problems. return res.status(500).send("something"). How can I solve it? can you help me?

  • @NaminderSingh
    @NaminderSingh 3 года назад

    Can we call API and show the response in the ssr itself?

  • @rohansadhukhan3028
    @rohansadhukhan3028 3 года назад

    thanks dude its working !

  • @kashtichi
    @kashtichi Год назад +1

    greate, but how should put it on cpanel host?

  • @FullStackDevGreg
    @FullStackDevGreg 2 года назад

    LocalStorage WrongReferenceError error, how can I insert normal js function,

  • @lynnickwan808
    @lynnickwan808 3 года назад

    how to ignore css in typescript for server render?

  • @MathewThomasMa2
    @MathewThomasMa2 4 года назад

    Great video!! but what if I have different routes in my App file? i am facing errors if I am using BrowserRouter.

  • @devabra_com
    @devabra_com 3 года назад

    very good solution. is it works redux case?