Home / Function/ warnForStyleProps() — react Function Reference

warnForStyleProps() — react Function Reference

Architecture documentation for the warnForStyleProps() function in NativeMethodsMixinUtils.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  2fc8cb95_506c_2307_15e7_dcf60b7cf9c2["warnForStyleProps()"]
  78f5be05_fc7e_f09a_e92e_c046356e87a8["NativeMethodsMixinUtils.js"]
  2fc8cb95_506c_2307_15e7_dcf60b7cf9c2 -->|defined in| 78f5be05_fc7e_f09a_e92e_c046356e87a8
  style 2fc8cb95_506c_2307_15e7_dcf60b7cf9c2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-native-renderer/src/NativeMethodsMixinUtils.js lines 48–64

export function warnForStyleProps(props: any, validAttributes: any) {
  if (__DEV__) {
    for (const key in validAttributes.style) {
      if (!(validAttributes[key] || props[key] === undefined)) {
        console.error(
          'You are setting the style `{ %s' +
            ': ... }` as a prop. You ' +
            'should nest it in a style object. ' +
            'E.g. `{ style: { %s' +
            ': ... } }`',
          key,
          key,
        );
      }
    }
  }
}

Domain

Subdomains

Frequently Asked Questions

What does warnForStyleProps() do?
warnForStyleProps() is a function in the react codebase, defined in packages/react-native-renderer/src/NativeMethodsMixinUtils.js.
Where is warnForStyleProps() defined?
warnForStyleProps() is defined in packages/react-native-renderer/src/NativeMethodsMixinUtils.js at line 48.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free