FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
One component, two layouts: the dual view pattern in React
NewsWeb Development

One component, two layouts: the dual view pattern in React

via Dev.to ReactSammii4h ago

One component, two layouts: the dual view pattern in React My portfolio has two completely different layouts. A grid of cards that open into modals. A full-screen vertical carousel with snap scrolling. They look nothing alike and behave nothing alike. They share one component and one data file. That pattern is worth writing about. The shared data layer Everything starts with projects.js : a flat array of objects, one per project. Four fields each: id , title , techStack , info . Both views import it directly. Neither knows the other exists. export const projects = [ { id : " lunary " , title : " Lunary " , techStack : " Next.js, Prisma, PostgreSQL " , info : " A real-time astrology platform with birth charts, transit tracking, and synastry analysis. " , }, // ... ]; The id doubles as the GitHub repo slug, the image filename key, and the React list key. One field, three uses. That's a different article — the point here is that a single import drives both views. ProjectItem: one componen

Continue reading on Dev.to React

Opens in a new tab

Read Full Article
0 views

Related Articles

News

Judging the Future of Innovation: 2026 McGinnis Venture Competition at Carnegie Mellon University

Medium Programming • 27m ago

The Texas Senate Primary Was a Preview of Creator Wars to Come
News

The Texas Senate Primary Was a Preview of Creator Wars to Come

Wired • 32m ago

How Federal Agencies Got Caught Up in Trump's Anti-Immigration Crusade
News

How Federal Agencies Got Caught Up in Trump's Anti-Immigration Crusade

Wired • 58m ago

Image Segmentation with Watershed Algorithm: Separating Touching Objects
News

Image Segmentation with Watershed Algorithm: Separating Touching Objects

Medium Programming • 1h ago

Flux Weave Studio | Command
News

Flux Weave Studio | Command

Medium Programming • 1h ago

Discover More Articles