Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft of modality specific usePropsFor functions #5684

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alkwa-msft
Copy link
Contributor

What

We want to make separate exposed usePropsFor functions for Chat and Calling individually. This is because if you use the top-level usePropsFor function you will pull in all of the code and negate any opportunity for tree shaking. This is more of a problem when utilizing the Chat UI code and unfortunately pulling in all of the Calling code as well when using this function.

Is this a breaking change?
No, its an additive change.

Copy link
Contributor

github-actions bot commented Mar 5, 2025

}
};

export const useCallingPropsFor = <Component extends (props: any) => JSX.Element>(
Copy link
Member

@JamesBurnside JamesBurnside Mar 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of recreating these in the mergedHooks, reexport them in the index.ts directly from the packlets

export { usePropsFor as useCallingPropsFor, getSelector as getCallingSelector } from './hooks/usePropsFor';

}

if (!chatSelector) {
throw "Can't find corresponding selector for this component. Please check the supported components from Azure Communication UI Feature Component List.";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For an error like this is there a link we can provide to storybook?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants