react-native-vietnam / react-native-search-box

A simple search box with animation, inspired from ios search bar. Lightweight, fast, flexible.
476 stars 132 forks source link

cancelButtonStyle used both in <Animated.View> an <Text> causes warnings for some style properties #18

Open j-nolan opened 7 years ago

j-nolan commented 7 years ago

Hello,

It seems like the cancelButtonStyle prop is passed in two components:

This causes warnings when we uses style properties that are not compatible with bot <Animated.View /> and `.

Example:


<SearchBar
  cancelButtonStyle={{ fontSize: 20 }}
/>

Will show a warning:

Warning: Failed prop type: Invalid props.style key fontSize supplied to RCTView.

My suggestion would be to make two new props (cancelButtonViewStyle and cancelTextButtonStyle) to customize and <Text>. The cancelButtonStyle should throw a deprecation warning. This would be backward compatible.

I'd be happy to make a PR if this makes sense

anhtuank7c commented 7 years ago

@j-nolan Yes i am, use cancleButtonStyle to both View, Text L348 So impossible to using fontX props in cancleButtonStyle