Making Next.js Easier to Use
With most frameworks, a few initial changes made by the developer can make things easier to use and enhance your experience when creating new features for your application.
We'll cover the following
Use JSX files instead of JS files
Notice that the index inside the pages folder is a JS file. It works just fine, but there is one problem: there is little to no auto-completion help from your code editor. The syntax highlighting also leaves much to be desired. No worries though! There is an easy fix. Make index.js to a JSX file by changing the extension to .jsx
instead of .js
. It will look like index.jsx, and voila! You now have great auto-completion and syntax highlighting.
Get hands-on with 1200+ tech skills courses.