Giter VIP home page Giter VIP logo

Comments (6)

inovua-admin avatar inovua-admin commented on May 30, 2024 1

We've published v 4.0.9 which fixes the issue - you can see our changelog here https://reactdatagrid.io/docs/changelog#4.0.9

@lavoiekeven Feel free to reopen the issue if needed.

from reactdatagrid.

yurigenin avatar yurigenin commented on May 30, 2024

I just tried it and it works fine. Post the code below to any of the source editors on the site:

import React from 'react'

import ReactDataGrid from '@inovua/reactdatagrid-enterprise'
import Button from '@inovua/reactdatagrid-community/packages/Button'
import '@inovua/reactdatagrid-enterprise/index.css'

const gridStyle = { minHeight: 550 }

const columns = [
  { name: 'id', header: 'Id', defaultVisible: false, type: 'number', maxWidth: 40 },
  { name: 'firstName', header: 'First Name', defaultFlex: 2 },
  { name: 'lastName', header: 'Last Name', defaultFlex: 2 },
  { name: 'email', header: 'Email', defaultFlex: 3 }
];

function App() {
  const [dataSource, setDataSource] = React.useState([]);

  const loadData = () => {
    setDataSource([{ id: 1, firstName: 'test', lastName: "test1", email: '[email protected]' }]);
  }

  return (
    <div>
      <h3>Sort with remote data</h3>
      <div>
        <Button onClick={loadData}>Load async data</Button>
        <Button
          onClick={() => setDataSource([])}
          style={{ marginLeft: 10 }}
        >Clear data</Button>
      </div>

      <ReactDataGrid
        idProperty="id"
        style={gridStyle}
        columns={columns}
        dataSource={dataSource}
      />
    </div>
  );
}

export default () => <App />

from reactdatagrid.

lavoiekeven avatar lavoiekeven commented on May 30, 2024

@inovua/reactdatagrid-community version not @inovua/reactdatagrid-enterprise

I tried with node v12.19.0 and v14.15.0 on Chrome and Edge Chromium.

from reactdatagrid.

inovua-admin avatar inovua-admin commented on May 30, 2024

Thanks for reporting. Strangely enough, the same code is working fine in our examples, though definitely not working in the reproduction repo.
We noticed you're using React 17.0.1 and initially thought that might cause the issue, but even when downgrading to react 16.14.0 it is still reproducible.
We're on it

from reactdatagrid.

inovua-admin avatar inovua-admin commented on May 30, 2024

Even more oddly, it does work in the repro repo if you build the app for deployment - npm run build and then test in the deployed folder.

from reactdatagrid.

inovua-admin avatar inovua-admin commented on May 30, 2024

Turns out it's strict mode - this issue casts more light into the problem facebook/react#15074
We're actively working for coming up with a fix on this - thanks for reporting

from reactdatagrid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.