MCPcopy
hub / github.com/baidu/amis / componentDidUpdate

Method componentDidUpdate

packages/amis/src/renderers/PdfViewer.tsx:75–98  ·  view source on GitHub ↗
(prevProps: PdfViewerProps)

Source from the content-addressed store, hash-verified

73 }
74
75 componentDidUpdate(prevProps: PdfViewerProps) {
76 const props = this.props;
77
78 if (
79 isApiOutdated(prevProps.src, props.src, prevProps.data, props.data) ||
80 resolveVariableAndFilter(props.src, props.data, '| raw') !==
81 resolveVariableAndFilter(prevProps.src, prevProps.data, '| raw')
82 ) {
83 this.abortLoad();
84 setTimeout(() => {
85 this.fetchPdf();
86 }, 0);
87 }
88
89 if (getVariable(props.data, props.name)) {
90 if (
91 getVariable(prevProps.data, prevProps.name) !==
92 getVariable(props.data, props.name)
93 ) {
94 this.abortLoad();
95 this.renderPdf();
96 }
97 }
98 }
99
100 componentWillUnmount() {
101 this.abortLoad();

Callers

nothing calls this directly

Calls 6

abortLoadMethod · 0.95
fetchPdfMethod · 0.95
renderPdfMethod · 0.95
isApiOutdatedFunction · 0.90
resolveVariableAndFilterFunction · 0.90
getVariableFunction · 0.90

Tested by

no test coverage detected