Skip to content

Instantly share code, notes, and snippets.

@sashadev-sky
Last active February 20, 2019 09:44
Show Gist options
  • Save sashadev-sky/e24e6c7adadd52d017cae5ad6cc94a58 to your computer and use it in GitHub Desktop.
Save sashadev-sky/e24e6c7adadd52d017cae5ad6cc94a58 to your computer and use it in GitHub Desktop.
Node script to wrap a React component
import { Conversation } from 'chat-template';
import ReactDOM from 'react-dom';
import React from 'react';
const showChatTemplate = (messages, element, delay = 1, height = 300) => {
ReactDOM.render(<Conversation delay={delay} height={height} messages={messages} />,
element);
};
module.exports = showChatTemplate;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment