If you are uploading an excel file or replacing the state of the spreadsheet, you will have to manually trigger a full recalc.
You can also disable formula evaluation or reset teh cell dependency graph using options.
import {
SpreadsheetProvider,
CanvasGrid,
} from "@rowsncolumns/spreadsheet";
import { useSpreadsheetState } from "@rowsncolumns/spreadsheet-state";
const MySpreadsheet = () => {
const { calculateNow } = useSpreadsheetState({
...
});
return (
<div>
<input type="file" onChange={() => {
// Update sheets
// update sheet Data
// Update table
calculateNow({
// Formulas are not evaluated, only cell dependency graph is rebuilt
disableEvaluation: true,
// Optionally reset the entire dependency graph
resetDependencyGraph: true,
})
})
<CanvasGrid />
</div>
);
};
const App = () => (
<SpreadsheetProvider>
<MySpreadsheet />
</SpreadsheetProvider>
);