Open Exekyel opened 1 year ago
I was wondering the same thing.
Would it make sense to automatically convert parallel groups with folder names in kebab-case
to camelCase
in the component ? 🤔
Encountered the same problem today, thought default behaviour would be that NextJs converts it to camelCase.
I have the same problem. Has anyone found a workaround?
I have faced the same issue. After spending a couple of hours on a workaround, I found that naming the slot folder camelCase
will solve the problem. In your above scenario,
app/
└── parallel-routes
└─── @parallelPanel // this is camelCase
└───── page.tsx
Then in your layout.tsx
, you can do:-
export default function MyLayout({parallelPanel}: {parallelPanel: React.ReactNode;}) {
return <>
{/* your html here */}
{parallelPanel}
</>
}
I'm facing the same problem, it wouldn't make sense to use camelCase, since some file systems have case insensitivity
Kebab case works well with parallel routes. However, we cannot destructure props for these names. Use a param name for the prop object instead and access by square brackets.
Link to the code that reproduces this issue
https://codesandbox.io/p/sandbox/holy-tree-lrkxn5
To Reproduce
appDir
optionapp/parallel-routes
/parallel-routes
app/parallel-routes/@parallel-panel
/parallel-routes
Current vs. Expected behavior
I expected
/parallel-routes
to load, but instead the app cannot be rendered with the following error message:Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
App Router
Additional context
Note that the error happens even though the slot isn't referenced anywhere, so it's not possible to reference it even by quoting the slot name in the layout
I'm not able to find any documentation that uses parallel routes with slots that have more than one word in their name
We're using kebab case for most routing in our app because it seems to be the preferred convention in the docs: https://nextjs.org/docs/pages/building-your-application/routing/pages-and-layouts (re: first-post.js)
Is
kebab-case
supported for parallel slots or do we need to usecamelCase
?