The problem here is that once you use setSearch(text) you're changing the state of the component and that change trigger the re-rendering of the component itself so the rest of the code doesn't run.
I've never used react native so I'm not sure 100% but if you are using a Functional component you can do something like this
const [search, setSearch] = useState('')
useEffect(() => {
scaleValue.setValue(1)
Animated.timing(scaleValue,{
toValue:0.5,
duration:100,
easing: Easing.linear,
useNativeDriver:true
}).start();
}, [search])
return (<TextInput
style={styles.searchbox}
onChangeText={(text) => setSearch(text) }/>)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…