@azure/communication-react
Version:
React library for building modern communication user experiences utilizing Azure Communication Services
18 lines • 805 B
JavaScript
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import React, { useMemo } from 'react';
import { SendBox } from "../../../../react-components/src";
import { usePropsFor } from '../ChatComposite/hooks/usePropsFor';
/**
* @private
*/
export const SendBoxPicker = (props) => {
const sendBox = useMemo(() => React.createElement(SendBoxWrapper, Object.assign({}, props)), [props]);
return sendBox;
};
// Move SendBox initialization to a separate component as otherwise it will cause re-render for Suspense and _ErrorBoundary when props and sendBoxProps are updated
const SendBoxWrapper = (props) => {
const sendBoxProps = usePropsFor(SendBox);
return React.createElement(SendBox, Object.assign({}, sendBoxProps, props));
};
//# sourceMappingURL=SendBoxPicker.js.map