score:0
i have face the same issue before with typescript
.
create a file named custom.d.ts
in ./src
with the following content:
declare module "*.svg" {
const content: any;
export default content;
}
add the custom.d.ts
to tsconfig.json
as below
you will find this tsconfig.json
file in your project root folder.
"include": ["src/components", "src/custom.d.ts"]
source: https://webpack.js.org/guides/typescript/#importing-other-assets
hope this will resolve your issue.
Source: stackoverflow.com
Related Query
- What type to use for imported svg icon from an .svg file in React with Typescript?
- What Type should I use for TypeScript props with children?
- What type should I use for a React component with arbitrary properties?
- Use assignable type for RefObject in React with Typescript
- Typescript react - Could not find a declaration file for module ''react-materialize'. 'path/to/module-name.js' implicitly has an any type
- What typescript type do I use with useRef() hook when setting current manually?
- React with Typescript - Type { } is missing the following properties from type
- Specify type for file upload event in react typescript
- what is the correct type for a React instance of a component in typescript
- how to use .env file in a react js with typescript project?
- How do you correctly use React.lazy() in Typescript to import a react component with a generic type parameter?
- What is the correct typescript type for react children?
- can i use the tsx extension for test files if using react with typescript
- React how to use icon inside Textfield Material-UI with TypeScript
- what is proper way to import multiple components from same file in react instead of getting each component imported
- What type should I use for input react-bootstrap event with TypeScript?
- How to use radium in React typescript (Error: has no properties in common with type 'CSSProperties'. TS2559)?
- How do I use a custom SVG file with material-ui Icon Component?
- Display markdown file from path in react with typescript
- lodash , convert string from svg circle (properties and values separates with space) to object for spread in react component inline
- What is the correct type to use for this React form field hook?
- How in react to display svg icon from file as inline without making http request?
- How do I use the type of imported JSON file in TypeScript
- What is the best practice with React for importing a large static array to use in a select field?
- What typescript type should I use for Reactstrap Input Ref?
- How can i restrict user from not selecting other file types using input type file with react and typescript?
- React with Axios, for the response I got from a GET, I want to use another GET, I want to sum up values from certain fields
- Typescript error: Create Alpha from RGBA as an Input with type number, not a string while using React JS?
- I have been trying to use Fetch to get data from an external json file with react but kept getting errors
- What type does a component have in react with typescript
More Query from same tag
- How to disable button cell when clicked in for loop?
- How to write dynamic routing for SEO friendly URL's in React JS
- React.memo() vs React functional component
- [TypeError: (0 , react_router_dom_1.useParams) is not a function]
- Correct way to fetch data when switching route on same level in react-router?
- Flux react, can an action get a store?
- React DND - Use different name prop for each compoents
- Updating Context State Values using Hooks
- Custom checkbox with label not fitting
- CSS Modules and CSS keyframe animations
- Uncaught TypeError: Cannot read properties of null (reading 'title') - React Router
- Central style sheet for react native?
- action creators not available as functions in props when passed directly to connect
- Multiple field names on single input
- how to get min or max dates from a list of dates using moment.js?
- Make counter not be less than zero in React.js
- Yup validation requiring at least one selection
- How to apply styling to MapView when using @arcgis/core for imports?
- How to bind a function's "this" to a class (React Component)
- Set local state according to Mobx state
- Cannot delete product item from Firebase
- Updating Item Listing using React, Redux. and Redux Form
- React render data with array index
- React .map only returning first item
- getStaticPaths not creating paths
- Not getting data in react redux
- How to make text box first value non editable in React js?
- Launching interval after updating props in React.js
- How to pass down props down to a React component having same keys and values
- useCallback with dependency vs using a ref to call the last version of the function