Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google AMP with React

We have an isomorphic react App with node. I want to convert some pages to AMP pages. I am confused! Shall we go for a separate AMP version of the app or shall we modify the current app according to Google guidelines for AMP Pages? I can see we have to make a lot of changes in the current app to make an amp compatible version. How should I proceed?

like image 726
Harsh Sarohi Avatar asked Apr 12 '17 10:04

Harsh Sarohi


People also ask

Can we use AMP With React?

I am assuming you already have a React app and you are happy. You can opt-in to AMP on a page-by-page basis, and that's exactly what you should do. Most importantly, make sure to measure exactly how AMP performs while stepping into the waters slowly.

Does Google use Reactjs?

“Google employees are not allowed to use React!” Nope, the patent grant was updated in response to their feedback: code.facebook.com/posts/16394739… sunil pai, inc. not to mention all the goodwill FB would lose (internally and externally) if they sued someone for using react.

Can you use React with Hugo?

Hugo, that I use for my static site, does not directly have support for transpiling React. But with a few small steps you can make React transpiling as a part of your Hugo build and use React for your user experiences.

Does Google use AMP?

Well, Google's Top Stories Carousel on mobile devices only uses AMP cache to display articles. Plus, AMP is required to rank No. 1 in Google's mobile search results. So, if you want to rank in this carousel, you better get with the program.


1 Answers

Next.js now supports AMP. They provide multiple approaches (AMP-only & AMP-hybrid) to solve this problem. Since you can enable AMP on page level you can slowly migrate to a full AMP website.

Example

// pages/about.js export const config = { amp: true }  export default function AboutPage(props) {   return <h3>My AMP About Page!</h3> } 

This way you can support both. React client rendering and pure AMP.

Docs Next.js AMP

like image 56
HaNdTriX Avatar answered Sep 22 '22 15:09

HaNdTriX