Invariant Violation: ReactCompositeComponent.render()
monte-hayward opened this issue · 1 comments
monte-hayward commented
Uncaught Error: Invariant Violation: ReactCompositeComponent.render(): A valid ReactComponent must be returned. You may have returned undefined, an array or some other invalid object.
import IconSVG from '../../../../../node_modules/svg-inline-loader/lib/component.jsx';
// ...
<IconSVG src="/public/images/video_controls_volume_icon.svg" className="toggle" />
sairion commented
Hello! Thanks for report. It seems like IconSVG is not loaded properly, returning undefined.
(can be, but doesn't seem like much related) First of all you can import the component directly from module other than manually specifying rel path:
import IconSVG from 'svg-inline-loader/lib/component.jsx';
and you need to require 'svg':
<IconSVG src={require('/public/images/video_controls_volume_icon.svg')} className="toggle" />
Are you using Webpack? What kind of React version are you using? Is component.jsx
bundled correctly? More infos would be helpful!