// replace this{renderHeader?(renderHeader()):header!==null?(<ListHeader>{header}</ListHeader>
):null}// with this{renderHeader!==undefined?renderHeader():<ListHeader>{header}</ListHeader>
}
That way you don't need the extra header={null} prop but just can pass renderHeader={() => null}. Otherwise you would allow to pass header={null} and a renderHeader function, which should not exist at the same time.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Very well explained article, thanks! Love it ☺
I'd prefer a little adjustment though:
That way you don't need the extra
header={null}
prop but just can passrenderHeader={() => null}
. Otherwise you would allow to passheader={null}
and arenderHeader
function, which should not exist at the same time.