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
Often times a callback prop is assigned an empty function (() => {}) as the default value. The showDefaultProps method is simply looking for equality (I believe), so it won't catch a default prop that is just an empty function. In those cases, I had to add some logic in the filterProps property to make those not appear but I don't think this is the best solution and I would love it if the showDefaultProps would catch those as well or if there was another option I can set so those empty functions don't show up in the generated string.
filterProps: value=>{// Omit empty functions (they're likely from default props and `showDefaultProps` doesn't catch those)if(!isFunction(value)){returntrue;}returnvalue.toString()!=='() => {}';},
The text was updated successfully, but these errors were encountered:
Often times a callback prop is assigned an empty function (
() => {}
) as the default value. TheshowDefaultProps
method is simply looking for equality (I believe), so it won't catch a default prop that is just an empty function. In those cases, I had to add some logic in thefilterProps
property to make those not appear but I don't think this is the best solution and I would love it if theshowDefaultProps
would catch those as well or if there was another option I can set so those empty functions don't show up in the generated string.The text was updated successfully, but these errors were encountered: