th3rdwave / react-native-safe-area-context

A flexible way to handle safe area insets in JS. Also works on Android and Web!
MIT License
2.14k stars 197 forks source link

Complete the partial memoization of provider #427

Closed Noitidart closed 1 year ago

Noitidart commented 1 year ago

Summary

I saw some memoization in the provider. It was just partial memoization. I thought to complete the memoization. I'm not sure of the implications memoization had, but partial memoization defeats the purpose. Related: #426

The first commit to use the setState callbacks that one I'm very confident about. Memoizing the whole component in the third commit, and memozing style, I'm not sure if any benefits. But it completes the memoizing.

Test Plan

Old tests still stand.

Noitidart commented 1 year ago

I'm not able to get the snapshot tests updated, can I please get some help to update the snapshots. Running yarn test is giving me java errors which I'm not able to fix.

jacobp100 commented 1 year ago

Run yarn jest -u

Noitidart commented 1 year ago

Thanks! Updated!

janicduplessis commented 1 year ago

Looks good, thanks for this!

Noitidart commented 1 year ago

Thank you!