Menu

3 Subtle React Native & Web Bugs I Hunted Today (Child-Before-Parent Effects, Android Modal Insets & Web Locks)
📰

3 Subtle React Native & Web Bugs I Hunted Today (Child-Before-Parent Effects, Android Modal Insets & Web Locks)

DEV Community: frontend·sinescribe·about 3 hours ago
#dZi5hra8
#devtofrontend#devto#dev#state#react
Long article (707 words) — no AI summary yet.
Reading 0:00
15s threshold

While hunting production open-source bugs today across large React Native (New Architecture + HybridApp) and React Web codebases, I ran into three subtle failure modes that slip right past standard code reviews.

Here is the exact root-cause breakdown for each bug, how to fix them deterministically, and the tools I used to trace them.

1. React Child-Before-Parent useEffect Order Clobbering URL Deep Links

Suppose you have a parent AddressPage that synchronizes an Onyx/Redux address object into local React state ( state , country , city , zip ), and a child StateSelector component that reads a ?state=MO URL query parameter on mount:

// Child: StateSelector.tsx useEffect ( ( ) => { if ( ! stateFromUrl ) return ; onInputChange ( stateFromUrl ) ; // calls parent setState('MO') Navigation . setParams ( { state : undefined } ) ; // cleans up URL } , [ stateFromUrl ] ) ;

// Parent: AddressPage.tsx useEffect ( ( ) => { if ( ! address ) return ; setState ( address . state ) ; // overwrites 'MO' with saved 'CA'!…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.