Closed sharief-acc closed 2 years ago
package shows in node_modules ?
I think you're missing an index.js on your published npm package.
Gotta import with:
import BingMapsReact from "bingmaps-react/BingMapsReact";
@sharief-acc @jimmywim are you both using typescript? This package wasn't built with typescript in mind but it's on the roadmap and I'm happy to look into the issue.
I just created a fresh react app with version 1.1.1 and am not having issues installing or using the package as follows:
npm install bing maps-react
import "./App.css";
import BingMapsReact from "bingmaps-react";
function App() {
return (
<div className="App">
<BingMapsReact />
</div>
);
}
export default App;
node_modules shows the files as expected:
I just published a new version, 1.1.4, that may resolve your issues. Please let me know.
@sharief-acc @jimmywim I added some simple TS support via some minimal declarations. I expect this to work in TS apps without any hassle now.
Install the latest version 1.1.1 and getting the error --> Cannot find module 'bingmaps-react' or its corresponding type declarations.ts(2307) import BingMapsReact from "bingmaps-react";