question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow injecting default MediaQuery value in SSR

See original GitHub issue

Feature Request

What is the desired behavior?

It should be possible to provide a custom default value for the MediaQuery on the servers side for FlexLayoutServerModule to use. Right now it always uses ‘sm’. At least it supposed to use it but actually in 7.0.0-beta.23 it instead uses ‘all’ and simultaneously applies all impossible rules…

What is the use-case or motivation for the desired behavior?

Last MediaQuery value from the client side can be stored in cookies and used next time on the server side. In most cases user would have the same window size as from the last visit. Especially if it was a mobile device. So we can safely use it on the server side to generate a proper view. flex-layout library should not take care of last MediaQuery value storage. Only the way to override its default one is necessary.

Is there anything else we should know?

As I’ve mentioned above - in 7.0.0-beta.23 MediaQuery defaults to ‘all’ instead of ‘sm’ on the server side.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
CaerusKarucommented, Jan 21, 2019

Yes, you can do that instead of using the static method. The static method just aliases to providing that token value

0reactions
angular-automatic-lock-bot[bot]commented, Sep 5, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Media queries in React for responsive design - Material UI - MUI
It allows the rendering of components based on whether the query matches or not. ... There is no default theme support, you have...
Read more >
Using CSS media queries in React with Fresnel
To initialize a new project, run npm init -y . Notice that the -y tag will approve all the default values for the...
Read more >
Using media queries - CSS: Cascading Style Sheets | MDN
A media query computes to true when the media type (if specified) matches the device on which a document is being displayed and...
Read more >
Advanced Usage - styled-components
To illustrate this, let's create our Button component, but this time ... We are passing a default theme for Buttons that arent wrapped...
Read more >
Frontend Handbook | React / Chakra UI - Infinum
It allows us to use all of the Button props and all of the a props without having ... defaultProps are default values...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found