mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-30 09:03:15 +00:00
Merge branch 'main' into feat/sources-in-react-widget
This commit is contained in:
@@ -1,14 +1,8 @@
|
||||
import React from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { DocsGPTWidget } from './components/DocsGPTWidget';
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
const renderWidget = (elementId: string, props={}) => {
|
||||
const root = createRoot(document.getElementById(elementId) as HTMLElement);
|
||||
root.render(
|
||||
<DocsGPTWidget {...props} />
|
||||
);
|
||||
};
|
||||
(window as any).renderDocsGPTWidget = renderWidget;
|
||||
}
|
||||
export { DocsGPTWidget };
|
||||
//development
|
||||
import { createRoot } from "react-dom/client";
|
||||
import { App } from "./App";
|
||||
import React from "react";
|
||||
const container = document.getElementById("app") as HTMLElement;
|
||||
const root = createRoot(container)
|
||||
root.render(<App />);
|
||||
|
||||
Reference in New Issue
Block a user