Created
January 29, 2021 22:14
-
-
Save treygriffith/71ae9205190dfe431df88f1937bfb313 to your computer and use it in GitHub Desktop.
Using the Xkit Embedded Catalog with React
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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