folofse / androw

Shadows in React Native for Android
97 stars 16 forks source link

Components wrapped with Androw doesnt rerender on old Android #13

Closed albeitreluctantly closed 4 years ago

albeitreluctantly commented 5 years ago

Hi. There's an issue with updating components view. On android 9 everything's fine. I have not tested on 8, but on android 7 component wrapped with Androw becomes static, it updates it's view only once.

const Component:FC = () => {
 const [buttonName, setButtonName] = useState('Button')

 useEffect(()=> {
 setTimeout(() => {
   setButtonName('Definitely not button')
  }, 1000)
 })

 return <Androw><Button>{name}</Button></Androw>
}

In that example code the button's name will always remain 'Button'.

folofse commented 5 years ago

@Solistratos, Yes, it seems like the rerender not triggers in Android 7.0. I will look in to this and see if I can find any solution.

thilek commented 4 years ago

@Solistratos, in RNAndrowLayout.java inside dispatchDraw(Canvas canvas), removing the else and moving super.dispatchDraw(canvas); outside fixed the issue. In this case super.dispatchDraw(canvas); always will be called.

Will test it in few more devices and if it works will submit a PR for this fix.

rferdosi commented 4 years ago

Still not working in android 5.