Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditionally Rendering Step Content #606

Open
pulkit1joshi opened this issue Nov 10, 2023 · 1 comment
Open

Conditionally Rendering Step Content #606

pulkit1joshi opened this issue Nov 10, 2023 · 1 comment

Comments

@pulkit1joshi
Copy link

Hi,

For content, I have a custom component.

`
const Component = () => {
const { paramName } = useParams();

if(paramName) => return somehing
return ( return something else)
}
`

[{
content: <?Component?>,
selector: '.selector'
}]

The param inside here returns null but the param used in the actual render component just before the step that uses this component returns correct value. I tried various permutations here, but found it weird.

My path is: /x/y/1

Inside the component added to the step:
useLocation returns: /x/y/1
useParam returns {} but it should return {z: 1}

Inside the component that is rendered in the above route:
useParam: returns {z: 1}

@elrumordelaluz
Copy link
Owner

Hi @pulkit1joshi, thanks for open the Issue.

Mind creating a minimal reproduction in a sandbox in order to allow others to debug faster your use-case and try to find a solution as soon as possible? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants