You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you try to pass histories (type History[]) to setPuckInitialHistory when appendData is false, there is a type error.
Type 'History[]' is not assignable to type '[History<Partial<AppState<Data<DefaultComponentProps, DefaultRootFieldProps>>>>, ...History<...>[]]'.
Source provides no match for required element at position 0 in target.
Why does InitialHistory's type need the InitialHistoryNoAppend version? The histories type between InitialHistoryNoAppend and InitialHistoryAppend are [History<AS>, ...History<AS>[]] and History<AS>[], respectively.
The text was updated successfully, but these errors were encountered:
Puck always requires one initial item in the history. It derives an initial app state (called generatedAppState) based on default Puck state.
If appendData: true, the generatedAppState is always inserted after the initial histories provided by the user. This ensures there is always at least one item in the history.
If appendData: false, then the generatedAppState is not inserted at all. Instead, the user must specify at least one history item.
If you're not providing any history or appending data, then Puck will be unable to determine the initial state. To counter this, I suggest inserting an empty history item.
If you try to pass histories (type History[]) to setPuckInitialHistory when appendData is false, there is a type error.
If appendData is true it works fine though.
The documentation shows the type as History[] too.
Why does InitialHistory's type need the InitialHistoryNoAppend version? The histories type between InitialHistoryNoAppend and InitialHistoryAppend are
[History<AS>, ...History<AS>[]]
andHistory<AS>[]
, respectively.The text was updated successfully, but these errors were encountered: