signal-desktop/ts/state/roots/createCompositionArea.tsx

22 lines
700 B
TypeScript
Raw Normal View History

2019-05-24 23:58:27 +00:00
import React from 'react';
import { Provider } from 'react-redux';
import { Store } from 'redux';
import { SmartCompositionArea } from '../smart/CompositionArea';
2019-05-24 23:58:27 +00:00
// Workaround: A react component's required properties are filtering up through connect()
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/31363
/* eslint-disable @typescript-eslint/no-explicit-any */
const FilteredCompositionArea = SmartCompositionArea as any;
/* eslint-enable @typescript-eslint/no-explicit-any */
2019-05-24 23:58:27 +00:00
export const createCompositionArea = (
store: Store,
props: Record<string, unknown>
): React.ReactElement => (
2019-05-24 23:58:27 +00:00
<Provider store={store}>
<FilteredCompositionArea {...props} />
2019-05-24 23:58:27 +00:00
</Provider>
);