naver / egjs-infinitegrid

A module used to arrange card elements including content infinitely on a grid layout.
https://naver.github.io/egjs-infinitegrid/
MIT License
2.22k stars 95 forks source link

[React] Cannot read property 'clientWidth' of null #126

Closed ivorpad closed 6 years ago

ivorpad commented 6 years ago

Description

Unfortunately I can't get InfiniteGrid to work in React 16.1.1.

screen shot 2018-04-02 at 09 54 38
import React from 'react';
import { render } from 'react-dom';
import { GridLayout } from "@egjs/react-layout";

const App = () => {
    return (
      <GridLayout tag="div" horizontal={true}>
        <div><img src="https://images.unsplash.com/photo-1522620444120-1a893f1d495b" /></div>
        <div><img src="https://images.unsplash.com/photo-1522620444120-1a893f1d495b" /></div>
        <div><img src="https://images.unsplash.com/photo-1522620444120-1a893f1d495b" /></div>
        <div><img src="https://images.unsplash.com/photo-1522620444120-1a893f1d495b" /></div>
        <div><img src="https://images.unsplash.com/photo-1522620444120-1a893f1d495b" /></div>
      </GridLayout>
    );
}

render(<App />, document.getElementById('root'));

Steps to check or reproduce

To reproduce: https://stackblitz.com/edit/react-xvz2ax

daybrush commented 6 years ago

@egjs/react-layout 1.2.4 version has been deployed and its bugs fixed. Please try it. Thank you.