MCPcopy
hub / github.com/plotly/dash / DataTable

Function DataTable

components/dash-table/src/dash-table/dash/fragments/DataTable.js:11–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9import {propTypes} from '../DataTable';
10
11const DataTable = props => {
12 const ctx = window.dash_component_api.useDashContext();
13 const isLoading = ctx.useLoading({
14 filterFunc: loading =>
15 loading.property === 'data' ||
16 loading.property === '' ||
17 loading.property === undefined
18 });
19 const id = useMemo(() => id || genRandomId('table-'), [id]);
20 const sanitizer = useMemo(() => new Sanitizer(), []);
21
22 if (!isValidProps(props)) {
23 return <div>Invalid props combination</div>;
24 }
25
26 const sanitizedProps = sanitizer.sanitize(props, isLoading);
27 return props.id ? (
28 <RealTable {...sanitizedProps} />
29 ) : (
30 <RealTable {...sanitizedProps} id={id} />
31 );
32};
33
34DataTable.propTypes = propTypes;
35

Callers

nothing calls this directly

Calls 3

useMemoFunction · 0.90
genRandomIdFunction · 0.85
sanitizeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…