React Spreadsheet is a library for building simple, customizable, and performant spreadsheet components within React applications. As of version 0.10.1, it focuses on providing a straightforward API for common use cases while maintaining flexibility. It has seen consistent updates, with recent releases introducing a new formula evaluation engine that supports cell dependencies and ranges (v0.8.0), and features like row/column selection (v0.7.0). The library differentiates itself by emphasizing 'Just Components™' and aiming for performance without virtualization, making it suitable for scenarios where a fully virtualized, complex spreadsheet might be overkill. It ships with TypeScript type declarations, ensuring a better developer experience with type introspection.
npm install react-spreadsheetVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates the basic setup of `react-spreadsheet`, showing how to render a simple spreadsheet component with initial data, including a basic formula, and handle changes to its content.
Refactor custom formula handling to align with the new formula evaluation engine's capabilities. Consult the library's documentation for the updated approach to managing cell bindings and dependencies.
If you have custom row rendering logic, update it to use `HeaderRow` for the spreadsheet's header and `Row` for the main data body rows accordingly.
Avoid direct reliance on `CellDescriptor`. While it may still function, migrate any custom logic or type definitions that use it to the updated public API and types provided by the library.
Ensure `react`, `react-dom`, and `scheduler` are installed in your project and meet the specified version requirements. Update your `package.json` and reinstall if necessary.
Change the import statement from `import Spreadsheet from 'react-spreadsheet'` to `import { Spreadsheet } from 'react-spreadsheet'`.Use ES module named import syntax: `import { Spreadsheet } from 'react-spreadsheet';`. If CommonJS is strictly necessary, ensure you are correctly destructuring the named export: `const { Spreadsheet } = require('react-spreadsheet');`Upgrade `react-spreadsheet` to version `0.8.0` or higher to utilize the new formula evaluation engine that supports cell dependencies and ranges.