(JS-0682) Prefer default value for props
robotichead opened this issue · comments
Description
It is recommended to have a default value for props that are not marked as required
(except Boolean
props). Default values are required as these values might not provide, so having a default value is recommended.
Occurrences
There are 130 occurrences of this issue in the repository.
See all occurrences on DeepSource → deepsource.io/gh/robotichead/NearBeach/issue/JS-0682/occurrences/
Tips
The following are the preferred methods for each variable type;
variableA: {
type: Number,
default: 0,
},
variableB: {
type: String,
default: "",
},
variableC: Boolean, //Not needed for Booleans :D
variableD: {
type: Array,
default: function() {
return [];
},
},
Please note the array's default is.... .... .... a function.
@robotichead i would like to work on this issue, please assign this to me.