Skip to content

Commit ce7cb10

Browse files
guillaumebridaymichalsnik
authored andcommitted
Adding default array example of correct rule (#573)
* Adding default array example of correct rule * Updating examples for factory functions * Update require-valid-default-prop.md
1 parent 82d939c commit ce7cb10

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/rules/require-valid-default-prop.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,16 @@ props: {
4949
// object/array defaults should be returned from a factory function
5050
propE: {
5151
type: Object,
52-
default: function () {
52+
default() {
5353
return { message: 'hello' }
5454
}
55-
}
55+
},
56+
propF: {
57+
type: Array,
58+
default() {
59+
return []
60+
}
61+
}
5662
}
5763
```
5864

0 commit comments

Comments
 (0)