React Component Collapsing Issue: Ref Not Initialized During URL Parsing I have a component that should expand if it is selected. Here’s my current approach: