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
Defaulting a boolean to false is a natural default, akin [] for an array, {} for an object, and so on.
Realue’s decorator design guideline is to be modular and to set behavior from props as much as possible.
Should there be a different default value wanted, the defaultValue decorator can fulfill that:
constBooleanComponent=compose(defaultValue,boolean,)(({ value })=><span>{value ? 'True' : 'False'}</span>)// Sets `defaultValue` to `true` and renders <span>True</span><BooleanComponentdefaultValue/>
With current
boolean
implementation, default value isfalse
. It'd be nice to control this.The text was updated successfully, but these errors were encountered: