DEV Community

Discussion on: 10 Things NOT To Do When Building React Applications

Collapse
 
slide109 profile image
Savchenkov Dmitry

Thanks for the article, there are some great tips. Just a small amendment - I suppose it'd be better to avoid using double negation and use Boolean() instead.

const App = ({ items = [] }) => (
  <div>
    <h2>Here are your items:</h2>
    <div>
      {Boolean(items.length) &&
        items.map((item) => <div key={item.label}>{item.label}</div>)}
    </div>
  </div>
)