Skip to content

Instantly share code, notes, and snippets.

@AbhiAgarwal192
Last active April 17, 2021 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AbhiAgarwal192/adc96deb2cd456af3c9b69357e09673c to your computer and use it in GitHub Desktop.
Save AbhiAgarwal192/adc96deb2cd456af3c9b69357e09673c to your computer and use it in GitHub Desktop.
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import TableComponent from './Table/Table';
window.renderTable = (containerId) => {
ReactDOM.render(
<TableComponent />,
document.getElementById(containerId),
);
};
window.unmountTable = containerId => {
ReactDOM.unmountComponentAtNode(document.getElementById(containerId));
};
if (!document.getElementById('table-container')) {
ReactDOM.render(<TableComponent />, document.getElementById('root'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment