You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I tell Storybook my layout is actually being rendered deeply nested inside the /u/myname path so that useSelectedLayoutSegment returns the correct value?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
I have a route in
/app/u/[username]/page.tsx
and a layout next to the page.Inside the layout I use
useSelectedLayoutSegment
, and while running the app, it will returnnull
when the path is/u/myname
.On my story instead,
useSelectedLayoutSegment
returns"myname"
.My story is configured as follows:
How can I tell Storybook my layout is actually being rendered deeply nested inside the
/u/myname
path so thatuseSelectedLayoutSegment
returns the correct value?Additional information
No response
Create a reproduction
No response
Beta Was this translation helpful? Give feedback.
All reactions