1 year ago

#386053

test-img

Mayil

React Material UI Image Import Issue

I am new to React JS. I am getting this error while I try to import and use an SVG Image.

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Here is my code.

import { ReactComponent as RightArrowIcon } from '../public/icons/RightArrow.svg';

function JobFetch() {
  return (
  <IconButton>
<RightArrowIcon />
</IconButton>
);
}
export default JobFetch; 

Thanks in Advance.

reactjs

svg

import

material-ui

export

0 Answers

Your Answer

Accepted video resources