Grid.useBreakpoint is empty on initial render
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Reproduction link
Steps to reproduce
- consume
Grid.useBreakpoint();
- initial render will display empty object
What is expected?
I would expect Grid.useBreakpoint()
to return an initial value on the first render. This could also potentially not rerender a component consuming Grid.useBreakpoints()
.
You could initiate it by checking window.innerWidth
on mount.
I would be happy to create a PR for this.
What is actually happening?
initial render of Grid.useBreakpoint()
displays an empty object
Environment | Info |
---|---|
antd | 4.16.13 |
React | 17.0.2 |
System | macOs BigSur |
Browser | Firefox 93.0 |
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Is it possible to get initial breakpoint using react-grid-layout?
Example of props that are available once rendered. <ResponsiveGridLayout autoSize: ... initialBreakpoint === null) { // The very first time.
Read more >Developing responsive layouts with React Hooks
We are going to use React Hooks to create an elegant and, more importantly, reusable solution to the problem of creating responsive layouts ......
Read more >SSR for multiple breakpoints using React - DEV Community
Boundaries class names are set during hydration render (server and first client render), so this behaviour is controlled by the state. Variable ...
Read more >Grid - Ant Design
24 Grids System. ... Layout uses a 24 grid layout to define the width of each "box", ... Use useBreakpoint Hook provide personalized...
Read more >jtable is blank and empty - MSDN - Microsoft
i write certain piece of code using mvc 4 and jquery and jtable ,but data is not visible in grid ,only blank grid...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is by design since first render with screen info will break SSR hydrate.
Have you found a solution to this ? I am also in need to know the breakpoint on initial render.