Trying to augment the React Module to include an interface to allow icons
, below, to be a type of object.
import "react-app-polyfill/ie11"; // For IE 11 support
import "react-app-polyfill/stable";
import "core-js";
import "./polyfill";
import React from "react";
import ReactDOM from "react-dom";
import { Provider } from "react-redux";
import App from "./App";
import * as serviceWorker from "./serviceWorker";
import store from "./store";
import { icons } from "./assets/icons";
declare module "react" {
interface icons {
icons: object;
}
}
React.icons = icons;
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById("root")
);
serviceWorker.unregister()
Currently React.icons
, line 21 is presenting the error Property 'icons' does not exist on type 'typeof import("/home/nickisyourfan/Desktop/DEV/OnDeBand/app/node_modules/@types/react/index.d.ts")'.
Without the module augmentation,
declare module "react" {
interface icons {
icons: object;
}
}
```,
A similar error occurs: `Property 'icons' does not exist on type 'typeof React'.`
Any help is appreciated!