-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typing off for setPuckInitialHistory's histories #673
Comments
I believe if It would be useful to understand your use-case for this in particular |
|
Puck always requires one initial item in the history. It derives an initial app state (called
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. |
The localHistories I'm passing to histories is not empty. If I change it to
then TS is happy, but I have more than one item in the array. This also gives a TS error.
Perhaps I'm missing something obvious. |
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: