Bird's eye view to Next JS AMP
Because this is not my first write-up regarding AMP applications, I would like to straight away dig into the technical side.
If you are not aware of AMP please go through my previous article which describes AMP integration with React JS
When I wrote my previous article there is no direct integration for AMP with React JS.
But now, when it comes to Next JS I found it is part of the framework and I m writing this article. With Next.js you can turn any React page into an AMP page, with minimal config, and without leaving React.
Lets Begin
Let us have our first AMP Next JS page ready. We will be developing a page displaying an image using amp component within a Next JS application.
Next.js will automatically import all components used on a page and there is no need to manually import AMP component scripts:
Enable AMP in Next is very simple, add the following config to your page:
export const config = { amp: true }
The full implementation of image displaying page would be like below:
export const config = {…