Skip to content

Commit

Permalink
feat(*): react v15 - Functional components can now return null too
Browse files Browse the repository at this point in the history
  • Loading branch information
topheman committed Apr 16, 2016
1 parent 366001d commit a5f5b75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/common/DisplayStars.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const DisplayStars = ({number}) => {
</span>
);
}
return <noscript/>;
return null;
};

DisplayStars.propTypes = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/__tests__/DisplayStars.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('components/common/DisplayStars', () => {
});
it('should render nothing if props.number = 0', () => {
const wrapper = shallow(<DisplayStars number={0} />);
expect(wrapper.equals(<noscript/>)).to.be.true;
expect(wrapper.equals(null)).to.be.true;
});
});
});

0 comments on commit a5f5b75

Please sign in to comment.