import React, { FC, useContext } from 'react'; import { EventContext, Styled } from 'direflow-component'; import styles from './App.css'; interface IProps { componentTitle: string; sampleList: string[]; } const App: FC = (props) => { const dispatch = useContext(EventContext); const handleClick = () => { const event = new Event('my-event'); dispatch(event); }; const renderSampleList = props.sampleList.map((sample: string) => (
→ {sample}
)); return (
{props.componentTitle}
{renderSampleList}
); }; App.defaultProps = { componentTitle: '{{names.title}}', sampleList: [ 'Create with React', 'Build as Web Component', 'Use it anywhere!', ], } export default App;