2021-04-13
1082
#react
Jefferson Ighalo
42015
Apr 13, 2021 â‹… 3 min read

Using react-responsive to implement responsive design

Jefferson Ighalo I stand at the intersection of beautiful design, secure frontend applications, and fintech at scale. Lover of JavaScript; flirting with Java, Go, and Swift.

Recent posts:

Comparing Mutative Vs Immer Vs Reducers For Data Handling In React

Comparing React state tools: Mutative vs. Immer vs. reducers

Mutative processes data with better performance than both Immer and native reducers. Let’s compare these data handling options in React.

Rashedul Alam
Apr 26, 2024 â‹… 7 min read
Radix Ui Adoption Guide Overview Examples And Alternatives

Radix UI adoption guide: Overview, examples, and alternatives

Radix UI is quickly rising in popularity and has become an excellent go-to solution for building modern design systems and websites.

Nefe Emadamerho-Atori
Apr 25, 2024 â‹… 11 min read
Understanding The Css Revert Layer Keyword, Part Of Css Cascade Layers

Understanding the CSS revert-layer keyword

In this article, we’ll explore CSS cascade layers — and, specifically, the revert-layer keyword — to help you refine your styling strategy.

Chimezie Innocent
Apr 24, 2024 â‹… 6 min read
Exploring Nushell, A Rust Powered, Cross Platform Shell

Exploring Nushell, a Rust-powered, cross-platform shell

Nushell is a modern, performant, extensible shell built with Rust. Explore its pros, cons, and how to install and get started with it.

Oduah Chigozie
Apr 23, 2024 â‹… 6 min read
View all posts

One Reply to "Using react-responsive to implement responsive design"

  1. Good article. However, this doesn’t adhere to the principle of DRY (Do not Repeat Yourself). Creating a separate component for each viewport is far from ideal and doesn’t scale well. Consider using only one component and one stylesheet that contains each viewport’s styles nested under the corresponding media query. The mobile styles should be applied first and progressively overwritten by the styles for larger viewports because those devices are typically more powerful. If it’s very important for you not to load unnecessary styles then you can dynamically import the correct stylesheet based on the viewport into one component.

Leave a Reply