Skip to content

jim-king-2000/mobxSampleWithNext7

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MobX Sample with Next.js v7 & v8

Why creating the sample

Nearly all MobX samples recommand “transform-decorators-legacy” babel plug-in for supporting the decorator grammar. It works with next@6. When upgrading to Next@7 & Next@8, the babel plug-in “transform-decorators-legacy” is not available anymore. We have to look for the new plug-in(s) for the decorator grammar. So here is the sample.

The key point

The key point is in the .bablerc file. We have to use the two plug-ins below with the right arguments. And the order of the two lines cannot be changed.

// .babelrc
"plugins": [
  ["@babel/plugin-proposal-decorators", { "legacy": true }],
  ["@babel/plugin-proposal-class-properties", { "loose": true }]
]

About

The simplest MobX sample using Next.js@7 & Next.js@8.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published