This website requires JavaScript.
Explore
Help
Sign In
archive
/
rsnext
Watch
1
Star
0
Fork
You've already forked rsnext
0
Code
Issues
Pull requests
Projects
Releases
Packages
Wiki
Activity
Actions
a4eef95056
rsnext
/
test
/
integration
/
export-default-map
/
pages
/
index.js
3 lines
99 B
JavaScript
Raw
Normal View
History
Unescape
Escape
Remove `withAmp` and do not expose `isInAmpMode` (#7690) * Remove `withAmp` and do not expose `isInAmpMode` This pull request removes the `withAmp` higher-order component in favor of the exported configuration object. Retaining this backwards compatibility isn't worth the extra maintenance burden, given it hasn't been released for very long and the migration is ultra-simple. I'm :-1: on retaining backwards compatibility just for the sake of it. Migration example follows. I'm willing to write a codemod if reviewers feel it's necessary. *Before* ```js import { withAmp } from 'next/amp' function Home() { return <h1>My AMP Page</h1> } export default withAmp(Home) // or export default withAmp(Home, { hybrid: true }) ``` *After* ```js export default function Home() { return <h1>My AMP Page</h1> } export const config = { amp: true, // or amp: 'hybrid', } ``` * Fix { amp: 'hybrid' } Co-Authored-By: JJ Kasper <jj@jjsweb.site>
2019-06-29 00:04:24 +02:00
export
default
(
)
=>
<
p
>
Simple
hybrid
amp
/
non
-
amp
page
<
/
p
>
export
const
config
=
{
amp
:
'hybrid'
}
Reference in a new issue
Copy permalink