Quantcast
Channel: User Jack - Stack Overflow
Viewing all articles
Browse latest Browse all 40

How do I use this component with typescript and react?

$
0
0

I've tried to use this PropertyGrid with:

<property-grid id="pg1"></property-grid>

but I got the error:

Property 'property-grid' does not exist on type 'JSX.IntrinsicElements'.

importing:

import  'clean-web-ui-property-grid';

doesn't solve it either. I've tried to make it using a function like:

const createPropertyGrid = (  id: string,  config: CleanPropertyGrid.PropertyGridConfig,  options: CleanPropertyGrid.PropertyGridOptions,  data: any) => {  const propertyGridWrapper = document.getElementById(    id  ) as CleanPropertyGrid.PropertyGrid;  const propertyGrid = document.createElement("property-grid"  ) as CleanPropertyGrid.PropertyGrid;  propertyGrid.id = "pg" + id;  propertyGrid.config = config;  propertyGrid.options = options;  propertyGrid.selectedObject = data;  propertyGridWrapper.innerHTML = "";  propertyGridWrapper.appendChild(propertyGrid);};

doesn't work either. How do I fix this? here's a live example


Viewing all articles
Browse latest Browse all 40

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>