Unable to convert to react component
See original GitHub issueReact Component
import React from 'react'
import CupImage from './cup.svg'
class DashBoard extends React.Component{
render(){
return <div><CupImage/></div>
}
}
export default DashBoard
WebpackConfig.js { test: /.svg$/, loaders: [ { loader: ‘babel-loader’, query: { presets: [‘es2015’] } }, { loader: ‘react-svg’, query: { jsx: true } } ] }
Please let me know if i am missing some thing here in above example .
Unable to load this image having this below issue TypeError: Cannot call a class as a function
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Unable to convert any svg to react component #43 - GitHub
The problem is with your webpack config. I suppose this is a bug upstream that it doesn't accept plain functions. But you need...
Read more >Unable to convert ReactJS project to React-Redux
I am new to React-Redux, I've created a ReactJS project and I am trying to convert my project to React-Redux. I won't understand...
Read more >[Solved]-Unable to convert class component to function ...
Coding example for the question Unable to convert class component to function ... Segment } from "semantic-ui-react"; function App() { const [activeItem, ...
Read more >Refs Must Have Owner Warning - React
This usually means that you're trying to add a ref to a component that doesn't have an owner (that is, was not created...
Read more >JSX In Depth - React
If you want to test out how some specific JSX is converted into JavaScript, you can try out ... JSX type can't be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kubens With webpack2, you can pass options like this - https://github.com/boopathi/react-svg-loader#webpack-2x . You don’t need
JSON.stringify
.webpack<2 support is dropped in master.