Experimental splitting: Wrapping component in `React.memo()` causes `unexpected splitNode` error
mirague opened this issue · comments
Melvin Valster commented
Describe the bug
Wrapping the component:
in React.memo()
causes the following error:
[plugin:router-code-splitter-plugin] /home/projects/tanstack-router-5quplm/src/routes/posts.tsx?tsr-split:
Unexpected splitNode type ☝️: CallExpression
This does not work:
export const Route = createFileRoute('/posts')({
component: React.memo(PostsComponent),
});
function PostsComponent() {
return null
}
Omitting the React.memo()
call does not result in an error:
export const Route = createFileRoute('/posts')({
component: PostsComponent,
});
function PostsComponent() {
return null
}
Your Example Website or App
https://stackblitz.com/edit/tanstack-router-5quplm?file=src%2Froutes%2Fposts.tsx
Steps to Reproduce the Bug or Issue
- Click on Posts (or just hover over it)
- Crashes (see screenshot below)
Expected behavior
As a user I expected the code would not crash.
Screenshots or Videos
Platform
- OS: macOS, Arc 1.47
Additional context
No response