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

25 lines
788 B
TypeScript
Raw Normal View History

2020-10-30 20:34:04 +00:00
// Copyright 2019-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
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>
);