
Company News
Socket Has Acquired Secure Annex
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.
@fluentui-react-native/merge-props
Advanced tools
Utility for merging props with styles and caching style combinations
Utilities for merging styles and props (which contain styles)
The mergeProps routine handles merging props together. Generally this is a standard per property merge identical to the behavior of Object.assign with the following two exceptions:
props.style will be merged using mergeStyle above, including caching the resolved stylesprops.className will be joined together using spaces as a delimiter.Styles are defined using the standard react-native pattern and will be merged in a way that maintains object identity where possible.
This is a copy of the StyleProp definition from react-native. This is copied primarily in the case where it is used in web code where adding a dependency on the react-native package itself is not desireable.
The StyleProp pattern itself is allows a style to be provided as a style or a recursive array of styles. So the following pattern is allowed:
props = {
style: [{ ...style1 }, [{ ...style2 }, { ...style3 }, [{ ...style4 }]], { ...style5 }],
};
In this model merging styles can be effectively deferred by the following:
const styleToMerge = { ...values };
props.style = [props.style, styleToMerge];
This routine merges one or more react-native styles together. The inputs are styles in the StyleProp format referenced above. The various input styles will be flattened and merged together to produce a single non-flattened output style.
function mergeStyles<T>(...styles: StyleProp<T>[]): T;
This routine has a built-in caching layer that will attempt to ensure that object identity remains consistent. This means that style A + style B, where the references to A and B are the same, will always produce object C, where the reference will also be the same.
FAQs
Utility for merging props with styles and caching style combinations
The npm package @fluentui-react-native/merge-props receives a total of 6,736 weekly downloads. As such, @fluentui-react-native/merge-props popularity was classified as popular.
We found that @fluentui-react-native/merge-props demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.

Research
/Security News
Socket is tracking cloned Open VSX extensions tied to GlassWorm, with several updated from benign-looking sleepers into malware delivery vehicles.

Product
Reachability analysis for PHP is now available in experimental, helping teams identify which vulnerabilities are actually exploitable.