import ReactDOM from 'react-dom'; import React from 'react'; import {LocalistComponent} from './dist'; const localistRun = props => { const { target, heading, calendarurl, apikey, format, entries, daysahead, depts, group, keyword, hidedescription, truncatedescription, hideimages, hideaddcal, hidepagination, filterby, wrapperclass, listclass, itemclass, readmore, url, api, } = props; if (typeof document === 'undefined' || !document.getElementById(target)) { console.warn(`invalid target: ${target}`); return; } ReactDOM.render(, document.getElementById(target)); } // Add localist to the dom. if (typeof window !== 'undefined'){ // @ts-ignore: add element to window. window.localistViewer = localistRun; } export default localistRun;