Skip to content

Conversation

@azul
Copy link
Contributor

@azul azul commented Aug 7, 2020

Props of type array need a factory function for their defaults.

Otherwise when reusing the component
all might end up with a shared default array.

@azul azul force-pushed the fix-filelist-default branch from e8c1731 to 2a61078 Compare August 7, 2020 08:25
@azul azul requested a review from skjnldsv August 7, 2020 08:26
@azul
Copy link
Contributor Author

azul commented Aug 7, 2020

I ran into this when reusing a component in a different context.
It worked fine but printed a warning about this in the logs:

Invalid default value for prop "fileList": Props with type Object/Array must use a factory function to return the default value.

@skjnldsv
Copy link
Member

skjnldsv commented Aug 7, 2020

/compile amend /

Props of type array need a factory function for their defaults.

Otherwise when reusing the component
all might end up with a shared default array.

Signed-off-by: Azul <azul@riseup.net>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
@skjnldsv skjnldsv merged commit 80f2b6f into nextcloud:master Aug 7, 2020
@azul azul deleted the fix-filelist-default branch August 7, 2020 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants