Skip to content

Commit a5f5b75

Browse files
committed
feat(*): react v15 - Functional components can now return null too
Returning null on functional components instead of <noscript/> https://facebook.github.io/react/blog/2016/04/07/react-v15.html#functional-components-can-now-return-null-too
1 parent 366001d commit a5f5b75

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/common/DisplayStars.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const DisplayStars = ({number}) => {
88
</span>
99
);
1010
}
11-
return <noscript/>;
11+
return null;
1212
};
1313

1414
DisplayStars.propTypes = {

src/components/common/__tests__/DisplayStars.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('components/common/DisplayStars', () => {
1313
});
1414
it('should render nothing if props.number = 0', () => {
1515
const wrapper = shallow(<DisplayStars number={0} />);
16-
expect(wrapper.equals(<noscript/>)).to.be.true;
16+
expect(wrapper.equals(null)).to.be.true;
1717
});
1818
});
1919
});

0 commit comments

Comments
 (0)