mirror of
https://github.com/excalidraw/excalidraw
synced 2025-07-25 13:58:22 +08:00
feat: allow props.initialData to be a function (#8135)
This commit is contained in:
@ -2291,7 +2291,11 @@ class App extends React.Component<AppProps, AppState> {
|
||||
}
|
||||
let initialData = null;
|
||||
try {
|
||||
initialData = (await this.props.initialData) || null;
|
||||
if (typeof this.props.initialData === "function") {
|
||||
initialData = (await this.props.initialData()) || null;
|
||||
} else {
|
||||
initialData = (await this.props.initialData) || null;
|
||||
}
|
||||
if (initialData?.libraryItems) {
|
||||
this.library
|
||||
.updateLibrary({
|
||||
|
Reference in New Issue
Block a user