robbestad / react-iframe

Simple solution for using iframes in React
ISC License
436 stars 79 forks source link

Will not work for me at all ( does this work with typescript? ) #40

Closed margozzi closed 5 years ago

margozzi commented 5 years ago

In VS Code if I hover over the import statement I get this test in a popup:

Could not find a declaration file for module 'react-iframe'. 'c:/cloudguest/src/client-admin/react-material.eval/node_modules/react-iframe/index.min.js' implicitly has an 'any' type. Try npm install @types/react-iframe if it exists or add a new declaration (.d.ts) file containing declare module 'react-iframe';ts(7016)

When I run I get an error:

Check your code at App.js:43. in Route (at App.js:43) in Switch (at App.js:40) in div (at App.js:34) in App (at src/index.js:9) in Router (created by BrowserRouter) in BrowserRouter (at src/index.js:8) Warning: React.createElement: 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. index.js:1452

Here is how I am trying to use it:

import { Iframe } from 'react-iframe';

<Route path="/api-docs-swagger" render={props =>