Skip to content

Instantly share code, notes, and snippets.

@treygriffith
Created January 29, 2021 22:14
Show Gist options
  • Save treygriffith/71ae9205190dfe431df88f1937bfb313 to your computer and use it in GitHub Desktop.
Save treygriffith/71ae9205190dfe431df88f1937bfb313 to your computer and use it in GitHub Desktop.
Using the Xkit Embedded Catalog with React
import * as React from 'react'
import * as ReactDOM from 'react-dom'
interface IntegrationsProps {
path?: string
}
class Integrations extends React.Component<IntegrationsProps> {
private ref = React.createRef()
componentDidMount () {
window.xkit.renderCatalog(this.ref.current, {
hideTitle: true,
hideSearch: true,
rootPath: this.props.path
})
}
componentWillUnmount () {
window.xkit.unmountCatalog(this.ref.current)
}
render () {
return <div ref={this.ref}></div>
}
}
export default Integrations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment