react-spreadsheet | Simple , customizable yet performant spreadsheet for React | Frontend Utils library
kandi X-RAY | react-spreadsheet Summary
kandi X-RAY | react-spreadsheet Summary
Simple, customizable yet performant spreadsheet for React.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of react-spreadsheet
react-spreadsheet Key Features
react-spreadsheet Examples and Code Snippets
Community Discussions
Trending Discussions on react-spreadsheet
QUESTION
I use a react module that manages the use of spreadsheets: react-spreadsheet https://github.com/iddan/react-spreadsheet/
In my project, I need several spreadsheets, and therefore several tables that the user can add, modify, delete on the fly
At the beginning, I wanted to use a big useState variable where the data arrays would be concentrated in the form : stateData = [ [...arrays], [...arrays...] ]
But the module, which uses an OnChange function taking as value the setData, seems to bug when my stateData variable contains different arrays.
...ANSWER
Answered 2021-Dec-07 at 00:05Seeing your code and your comment, I'm assuming that:
- You have one
useState
nameddata
with ALL your data in it - You have multiple spreadsheets
- For each spreadsheet, you want to pass the
sheetData
and theonChange
that updates it
The issue in your code is that you're setting onChange={setData}
, meaning any change will override the WHOLE data object, not just the targeted index.
What you want to do is have your onChange
function be a function that updates only the right part of your state. So you'd do it like so:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install react-spreadsheet
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page