-
-
Notifications
You must be signed in to change notification settings - Fork 49
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed
Description
$ npx create-react-app demo --template redux-typescript
$ cd demo
$ npm install @textea/json-viewer --save
$ vim src/App.tsx
import JsonViewer from '@textea/json-viewer';
function App() {
const src = {'aaa': 'bbb'};
return (
<div className="App">
<JsonViewer src={src} />
</div>
);
}
export default App;
$ npm run build
TS2786: 'JsonViewer' cannot be used as a JSX component.
Its element type 'ReactElement<any, any> | Component<ReactJsonViewProps, any, any> | null' is not a valid JSX element.
Type 'Component<ReactJsonViewProps, any, any>' is not assignable to type 'Element | ElementClass | null'.
Type 'Component<ReactJsonViewProps, any, any>' is not assignable to type 'ElementClass'.
The types returned by 'render()' are incompatible between these types.
Type 'ReactNode' is not assignable to type 'Element | null'.
Type 'undefined' is not assignable to type 'Element | null'.
5 | return (
6 | <div className="App">
> 7 | <JsonViewer src={src} />
| ^^^^^^^^^^
8 | </div>
9 | );
10 | }
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed