Set Metadata Per Page Without Server Side Rendering Using react-snap

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ก.ย. 2024
  • In this video series, I work on my new personal website built using React.
    Website: www.celikk.me
    GitHub: github.com/cel...
    Playlist: • Personal Website with ...
    Twitch: / celikkoseoglu
    You should watch the react-helmet video before this one: • Set Page Title and Des...
    This is a continuation of my previous work using React Helmet. We've set the metadata for Google's web crawlers. Plus, users can see the correct titles when they browse our site. However, when they share the website using a slack message (or facebook, linkedin etc.), they will not get the correct tags.
    This is where react-snap comes into play. It crawls through your website at build time and generates all html files with the correct headers so when you share your website online, you will get the correct metadata per page.
    This is super useful because it eliminates the need for Server Side Rendering for my use case. Decreases complexity by a lot.

ความคิดเห็น • 60

  • @BERTDELASPEED
    @BERTDELASPEED 3 ปีที่แล้ว +11

    This man deserves a lot more than 300 subs guys ! the content is awesome and the knowledge is legit

    • @yvsh
      @yvsh ปีที่แล้ว

      Solid +1

  • @rajatkotian8887
    @rajatkotian8887 3 ปีที่แล้ว +1

    Thankyou so much...I was stuck hopelessly trying to convert Create react app to SSR for days!!!.... Thankyou!!!!!

  • @Furkan-mw7kw
    @Furkan-mw7kw 3 ปีที่แล้ว +1

    Çelik bey tekrardan merhaba, pakette şunu fark ettim ben apilerimde sayfalama kullanıyorum bu yüzden sadece 1. sayfadaki verilerin html renderini yapıyor bunun için tüm sayfaları tek tek gitmesi için bir özelliği mevcut mu acaba api de kendi oto page arttırarak çekeceği bir yöntem ?

  • @teracomvietphong
    @teracomvietphong 21 วันที่ผ่านมา

    I got an error:
    "UnhandledPromiseRejectionWarning Error: Execution context was destroyed, most likely because of a navigation."
    "error Command failed with exit code 1"
    when react-snap is running.
    Could you give me some advices ?

  • @ViVaManukonda
    @ViVaManukonda 3 ปีที่แล้ว +7

    In my case I need to generate dynamic meta info for links which are also dynamically generated based on url given by user. Any solution for this?

    • @gogaiosebashvili9487
      @gogaiosebashvili9487 ปีที่แล้ว +1

      hey, did you got solution?

    • @ViVaManukonda
      @ViVaManukonda ปีที่แล้ว +2

      @@gogaiosebashvili9487 I completely moved my user-facing code to nextjs to utilize SSG and dynamic pages

    • @yuhiahtyun5665
      @yuhiahtyun5665 ปีที่แล้ว +3

      @@ViVaManukonda bro me too

    • @guilherme1260
      @guilherme1260 หลายเดือนก่อน

      Bad… though I cloud find a solution with react too 😢need a dynamic og for a react 16

  • @Furkan-mw7kw
    @Furkan-mw7kw 3 ปีที่แล้ว +1

    Çelik merhaba videon için teşekkür ederim, işime çok yaradı ancak bir sorum olucak sana; ben kullanıcıların içerik üretebildiği bir proje geliştirdim ve ortalama günlük örnek veriyorum 30 içerik paylaşımı yapılıyor ve hepsinin dinamik title oluşturuluyor. Projede build işlemi yapmadan yeni eklenen içeriklerin title yazıları gelmiyor, her seferinde build mi yapmamız gerekiyor ya da bunu otomatik şekilde yapmamı sağlayacak bir yol var mı ? Cevabın için şimdiden teşekkür ederim.

    • @celikkoseoglu
      @celikkoseoglu  3 ปีที่แล้ว

      Boyle bir seyi server side rendering olmadan yapmak mumkun degil malesef. Degismeyen icerigi onceden pre-renderlayip kullaniciya sunabiliriz ama degisen icerigi pre-renderlamak mumkun degil.
      Next.js gibi kutuphanelere bakmani oneririm. Umarim en uygun cozumu bulursun. Iyi calismalar.

  • @saschagobbels2177
    @saschagobbels2177 11 หลายเดือนก่อน

    how about the problem with: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Anybody know how to fix ?

  • @kenzovancampenhout8437
    @kenzovancampenhout8437 2 ปีที่แล้ว

    I get this error that says 'TyperError: Object.fromEntries is not a function'. Does anyone know what might be going on here? (Yes, nodejs is up-to-date.)

  • @haonguyendev
    @haonguyendev 4 หลายเดือนก่อน

    second time npm run build dont create page static. help me

  • @DukeNuken2006
    @DukeNuken2006 3 ปีที่แล้ว

    I do not understand where react-snap store those static HTML pages when it runs after build. Is it in some folder? And how it force react engine to replace the default index.html with those static pages?

  • @RahulAhire
    @RahulAhire 4 ปีที่แล้ว +4

    I really wonder that you are frequently making videos from past 9 months and most of your content is really good and perfect for intermediate to advanced users but why there's isn't a lot of traffic and subscription on your channel.
    You should make your video search friendly and simple title along with catchy thumbnail

    • @celikkoseoglu
      @celikkoseoglu  4 ปีที่แล้ว +3

      I'm working on that. It probably takes some time for TH-cam proritise this video over all other react tutorials though. Also as you said, these videos are intended for intermediate+ levels. Many of those people know what they are doing and don't require tutorials. I mostly do this as a hobby at this point. Thanks a lot for your feedback.

    • @RahulAhire
      @RahulAhire 4 ปีที่แล้ว

      @@celikkoseoglu keep doing what you like ♥️

  • @aleksamitic6655
    @aleksamitic6655 3 ปีที่แล้ว +1

    Man, you are pure gold!

    • @celikkoseoglu
      @celikkoseoglu  3 ปีที่แล้ว +1

      Man, you too. Give the repo a star here and spread the word: github.com/celikkoseoglu/celikk-personal-website

    • @aleksamitic6655
      @aleksamitic6655 3 ปีที่แล้ว

      @@celikkoseoglu Yes I will do definitely on the discord group! Can you tell me what do you think about my portfolio, please?
      aleksamitic.com

  • @tod670
    @tod670 2 หลายเดือนก่อน

    Excelent man thanks!

    • @tod670
      @tod670 2 หลายเดือนก่อน

      on initial load, the components are all over the place. Not working right.

  • @balaji7731
    @balaji7731 3 ปีที่แล้ว

    postbuild: `react-snap` - I am getting this error after postbuild in package.json file

  • @polmatambunan
    @polmatambunan ปีที่แล้ว

    How if the data (title, description, image) must call an API? I mean dynamic meta tag.

    • @racer3285
      @racer3285 6 หลายเดือนก่อน

      Yes I have facing same issue

  • @beberage
    @beberage 4 ปีที่แล้ว

    Does this affect the css when build files are serve?

  • @manimarann1457
    @manimarann1457 3 ปีที่แล้ว

    i am not able to update meta-tags from child components. ( whatever props passed to helmet component from app.js file are getting overridden) could you help me out to solve this.
    Thanks in advance :)

  • @omozemojeaugustine3529
    @omozemojeaugustine3529 10 หลายเดือนก่อน

    Thanks for this

  • @khawarjatoi
    @khawarjatoi 3 ปีที่แล้ว +2

    Great videos. I was wondering if there is an alternative to react-snap? This package was last maintained 2 years ago. I can see lot of issues and open PRs on github. Also this doesn’t support typescript.

    • @celikkoseoglu
      @celikkoseoglu  3 ปีที่แล้ว +1

      I was looking to see if there was an alternative too. Haven't been able to find a solid replacement so far. Let me know if you find something and I can make a video about that too!

    • @Andy-si1pl
      @Andy-si1pl 2 ปีที่แล้ว

      @@celikkoseoglu all roads promise it's possible but eventually lead to NextJS 😭😭😭

  • @yashm05
    @yashm05 2 ปีที่แล้ว

    Thanks a lot bro, it worked!!!!

  • @ibrahimfrat8591
    @ibrahimfrat8591 3 ปีที่แล้ว

    Cok guzel bir video olmus. Gayet egitici ve ogretici. Title ve diger Meta tag lari dinamik olarak degistirmek icin ne tarz bir paket kullaniyorsun? Vanilla JS mi yoksa Helmet tarzi bir paket mi?

    • @celikkoseoglu
      @celikkoseoglu  3 ปีที่แล้ว +1

      Helmet. Bundan bir onceki videomda onu acikliyorum.

    • @ibrahimfrat8591
      @ibrahimfrat8591 3 ปีที่แล้ว +1

      Çelik Köseoğlu tesekkurler. Videolarin icerik olarak izledigim bir cok tutorialden cok daha iyi. Umarim daha cok kisiye ulasmanin bir yolunu bulursun. Kolay gelsin

    • @celikkoseoglu
      @celikkoseoglu  3 ปีที่แล้ว +1

      @@ibrahimfrat8591 eninde sonunda olucak (:

    • @ibrahimfrat8591
      @ibrahimfrat8591 3 ปีที่แล้ว +1

      Çelik Köseoğlu TH-cam senin videolarini kullanicilarin video feedlerinde gostermeye baslamis (en azindan benimkinde 😅). Bu sekilde yararli icerikler urettigin surece dedigin gibi eninde sonunda olacak :)

  • @gogaiosebashvili9487
    @gogaiosebashvili9487 ปีที่แล้ว +1

    is it working on react 18?

    • @zmitrook
      @zmitrook 10 หลายเดือนก่อน +1

      no

  • @bradgyemi342
    @bradgyemi342 3 ปีที่แล้ว

    Hey thanks for the video. I have implemented react-snap but it is only crawling my first page. I thought that this was caused by my use of onClick events over href attributes for changing pages but that isn't the case. I even inserted some raw tags in my first page and I'm still seeing the same problem. Only one page crawled at "/". Any ideas as to why this is?

    • @darkcrystal143
      @darkcrystal143 3 ปีที่แล้ว +1

      use route dude instead of anchor tag

    • @ishkapoor7931
      @ishkapoor7931 ปีที่แล้ว

      I used route but still facing the same issue. Can anyone help!

  • @oca1
    @oca1 ปีที่แล้ว

    Cok guzel my friend

  • @chanchalsolanki2349
    @chanchalsolanki2349 ปีที่แล้ว

    Is it possible to set dynamic meta tags using redux and redux-persist?

  • @08_mehuljadhav18
    @08_mehuljadhav18 2 ปีที่แล้ว

    Hello sir in this video you told at 03:40 that you will fix those warning in your future videos but you have not uploaded any video regarding solving of that warning which is coming from firebase. Sir please upload new video for solving that warning please.

  • @user-te2tm6sc5t
    @user-te2tm6sc5t 3 ปีที่แล้ว

    Thanks a lot

  • @darkcrystal143
    @darkcrystal143 3 ปีที่แล้ว

    bro there is an error while build

  • @cazterk
    @cazterk 2 ปีที่แล้ว

    how can i use react-snap in nextjs

    • @celikkoseoglu
      @celikkoseoglu  2 ปีที่แล้ว +1

      NextJS comes with SSR and static rendering. No need for this if you're using NextJS

  • @bugslogger
    @bugslogger 3 ปีที่แล้ว

    i need help

  • @andhikayp
    @andhikayp 3 ปีที่แล้ว

    Please zoom in your screen that we can see your code

  • @Grolliiitjk
    @Grolliiitjk 3 ปีที่แล้ว

    "npm ERR! missing script: build"

  • @mohdsajidshaikh4291
    @mohdsajidshaikh4291 4 ปีที่แล้ว

    Increase font size

  • @mehmetakifturhan9106
    @mehmetakifturhan9106 2 ปีที่แล้ว

    Hello, after the integrating react-snap into the website. React-snap adds '/' to the URL. I realized that you had the same problem (05:02 '/blog/airpodsPro' becomes '/blog/airpodsPro/'). I checked your website. It seems you solved this problem. Could you please share the solution? Thanks for the video.

    • @celikkoseoglu
      @celikkoseoglu  2 ปีที่แล้ว

      Why is having / at the end of the URL a problem?
      By the way, I've migrated my website to NextJS a month ago and I've been working on this for the last several months. The reason why you don't see a / anymore on my current website is because it's running on s completely different architecture

    • @Andy-si1pl
      @Andy-si1pl 2 ปีที่แล้ว

      @@celikkoseoglu aaaahgh. I came here to get away from next