--- title: ReactJS pagination_prev: demos/index pagination_next: demos/grid/index sidebar_position: 1 --- import current from '/version.js'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import CodeBlock from '@theme/CodeBlock'; ReactJS is a JS library for building user interfaces. This demo tries to cover common React data flow ideas and strategies. React familiarity is assumed. Other demos cover general React deployments, including: - [Static Site Generation powered by NextJS](/docs/demos/static/nextjs) - [iOS and Android applications powered by React Native](/docs/demos/mobile/reactnative) - [Desktop application powered by React Native Windows + macOS](/docs/demos/desktop/reactnative) - [React Data Grid UI component](/docs/demos/grid/rdg) - [Glide Data Grid UI component](/docs/demos/grid/gdg) ## Installation [The "Frameworks" section](/docs/getting-started/installation/frameworks) covers installation with Yarn and other package managers. The library can be imported directly from JS or JSX code with: ```js import { read, utils, writeFile } from 'xlsx'; ``` ## Internal State The various SheetJS APIs work with various data shapes. The preferred state depends on the application. ### Array of Objects Typically, some users will create a spreadsheet with source data that should be loaded into the site. This sheet will have known columns. #### State The example [presidents sheet](https://sheetjs.com/pres.xlsx) has one header row with "Name" and "Index" columns. The natural JS representation is an object for each row, using the values in the first rows as keys:
Spreadsheet | State |
---|---|
![`pres.xlsx` data](pathname:///pres.png) | ```js [ { Name: "Bill Clinton", Index: 42 }, { Name: "GeorgeW Bush", Index: 43 }, { Name: "Barack Obama", Index: 44 }, { Name: "Donald Trump", Index: 45 }, { Name: "Joseph Biden", Index: 46 } ] ``` |
Name | Index | {/* The `tbody` section includes the data rows */} {/* generate row (TR) for each president */} // highlight-start {pres.map(row => (
---|---|
{row.Name} | {row.Index} |
Name | Index | { /* generate row for each president */ // highlight-start pres.map(pres => (
---|---|
{pres.Name} | {pres.Index} |