Signature
Parameters
A tuple of two components that will share this config. Used only for type inference — not stored or used at runtime.
Configuration object. Identical structure to
styled() config — see styled() Config Properties for details.The config is validated against both components. If a variant value sets a prop that doesn’t exist on one of the components, TypeScript will error.Returns
The exact same config object (identity function). Zero runtime overhead — exists purely for type inference.Example
Type Safety
The config is validated against both components simultaneously. If a variant sets a prop that only exists on one component, TypeScript will catch it:See Also
- Shared Config — When and why to use styledConfig
- styled() — Create individual styled components
- TypeScript Guide — Type inference details