Reputation: 195
I have 2 projects React web app, one for the desktop site, one for the tablet site. Shared backend, the logic is almost the same but the UI, function and route are separate.
Now I want to combine them into one project, just run only command npm start
.
Assuming that the big screen will be the desktop site, the medium screen will be the tablet site.
Similar behaviour to Facebook Tiktok, they have a responsive UI for PC and can switch with the mobile-like UI if access from the tablet.
Upvotes: 2
Views: 630
Reputation: 239
Try adding a hook like this and include the desired component depending on screen width
Upvotes: 1