Skip to content

Commit

Permalink
fix(tools): better handle null propNames
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbonnet committed Feb 4, 2019
1 parent a82ae5a commit e603d23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ export function logProps(propNames, title) {
/*
Logs the provided `propNames` whenever they change.
The `title` defaults to the component name.
If no `propNames` are provided, logs all props.
If `propNames` is `nil`, logs all props.
*/
return Component =>
onPropsChange(propNames, props => {
onPropsChange(propNames || undefined, props => {
/* eslint-disable no-console */
console.group(title || Component.displayName || Component.name)
for (let name of propNames || keys(props)) {
Expand Down

0 comments on commit e603d23

Please sign in to comment.