An Interest In:
Web News this Week
- April 18, 2024
- April 17, 2024
- April 16, 2024
- April 15, 2024
- April 14, 2024
- April 13, 2024
- April 12, 2024
May 29, 2021 05:27 pm GMT
Original Link: https://dev.to/m_ahmad/migrating-a-notebook-app-from-react-to-next-js-3ljn
Migrating a notebook app from react to Next.js
I created a notebook app in react a few months ago. I wrote article about it.
Create a Notebook app with React, ChakraUi, and framerMotion
Muhammad Ahmad Apr 2 1 min read
#typescript #react #webdev #javascript
Now I migrated this app to Next.js smoothly.
Here are the few steps that will guide you how i did this.
Step 1
Installed next
in my project:
yarn add next
Step 2
Updated package.json
with the following scripts:
"scripts": { "dev": "next dev", "build": "next build", "start": "next start"}
Step 3
Created pages folder:
src/pages/_app.tsxsrc/pages/index.tsxsrc/pages/projects/index.tsx
Step 4
Migrated code:
from src/index.tsx and src/app.tsxto src/pages/index.tsx and src/pages/_app.tsx
Note: I didn't copy paste code here.
Step 5
Deleted these files:
src/index.tsxsrc/app.tsx
Final step
- Used
next/router
. - Replaced
chakra links
andreact-router-dom links
withnext/link
in different files.
App
Original Link: https://dev.to/m_ahmad/migrating-a-notebook-app-from-react-to-next-js-3ljn
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To