n4kz / react-native-indicators

Activity indicator collection for React Native
Other
917 stars 118 forks source link

How to remove warnings? #41

Open JiGewusuoweiju opened 2 months ago

JiGewusuoweiju commented 2 months ago

When using the UIActivityIndicator component, I found a warning about A props object containing a "key" prop is being spread into JSX: let props = {key: someKey, style: ..., children: ...}; <Animated(View) {...props} /> React keys must be passed directly to JSX without using spread:....

How do I remove the warning?

al4iii commented 2 months ago

When using the UIActivityIndicator component, I found a warning about A props object containing a "key" prop is being spread into JSX: let props = {key: someKey, style: ..., children: ...}; <Animated(View) {...props} /> React keys must be passed directly to JSX without using spread:....

How do I remove the warning?

\node_modules\react-native-indicators\src\components\material-indicator\index.js you need change start 110 line

    return (
      <Animated.View style={styles.layer} key={index}>
        <Animated.View style={layerStyle}>
          <Animated.View style={[containerStyle, offsetStyle]} collapsable={false}>
            <Animated.View style={viewportStyle}>
              <Animated.View style={containerStyle} collapsable={false}>
                <Animated.View style={lineStyle} />
              </Animated.View>
            </Animated.View>
          </Animated.View>
        </Animated.View>
      </Animated.View>
    );