Comments (2)
Hi @mattcolman
Should withMedia render the component before context.media is defined?
In case of SSR, yes
We've seen cases where we can see a jump where it renders the default view, and then when the media prop is defined it jumps to say the mobile view.
This is due to the server side calculation of what the default view is (or what the hint is)
There will be a double render "jump" if server and client wont match up - this is normal.
So you have 2 options:
- Make the server side calculation of screen size more accurate
- Dont use server side render option for your use case
I believe react-responsive won't render its children before media is defined.
It will if you have setup SSR with it, if you pass values https://github.com/contra/react-responsive#server-rendering
It doesnt need media on server
from react-media-query-hoc.
ok thanks @jooj123 !
from react-media-query-hoc.
Related Issues (14)
- Allow passing of values to matchmedia for Server Side Rendering HOT 1
- Context is not updated when state changes HOT 1
- Prevent MediaQueryProvider from printing any additional div HOT 5
- Use latest React createContext HOT 10
- Move to latest React, enzyme and babel HOT 1
- Add e2e test framework HOT 2
- Setup with nwb
- State being updated on window resize, context isn't. HOT 5
- Changelog for v1.0 ? HOT 1
- Add CI to the repo
- Update to Babel 7
- Fix Travis badge
- Setup semantic release
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-media-query-hoc.