UNPKG

@talkfurther/react

Version:

README.md

48 lines (44 loc) 1.29 kB
import React from 'react'; import { registerTeaserWebComponent, renderServerSide } from '@talkfurther/elements'; var version = "1.5.0"; class Teaser extends React.Component { constructor(props) { super(props); this.state = { isClient: false }; } componentDidMount() { // componentDidMount only runs in the client, // so when it runs, we know for sure it's client-side this.setState({ isClient: true }); const region = this.props.region; registerTeaserWebComponent({ region }); } render() { const props = this.props; const isClient = this.state.isClient; const html = isClient ? "" : renderServerSide(props); return React.createElement("further-teaser", { suppressHydrationWarning: true, dangerouslySetInnerHTML: { __html: html }, "vsa-instance": props.vsaInstance, "data-sdk-framework": "react", "data-sdk-react-version": version, title: props.title, subtitle: props.subtitle, options: JSON.stringify(props.options), "show-recent-tour-inquiries": props.showRecentTourInquiries, theme: JSON.stringify(props.theme || {}), "custom-css": props.customCss }); } } export { Teaser }; //# sourceMappingURL=index.modern.js.map