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

Child of Link component can't be React element anymore in v2.0.0 #18

Open
andrekovac opened this issue Sep 4, 2019 · 2 comments
Open

Comments

@andrekovac
Copy link

andrekovac commented Sep 4, 2019

The following code worked in buttermilk@1.1.2 but does not work in buttermilk@2.0.0 anymore:

import { Link } from 'buttermilk';
// ...

<Link href="/">
  <span>Home</span>
</Link>

Now no error is thrown, but it just doesn't link. Nothing happens when it actually should route to /.

When debugging I found that the <Link /> component only works if it's child is a string, e.g. <Link href="/">Home</Link>.

I saw you didn't change cjs.js in your v2.0.0. update, but something must have changed which influences this..

@quantizor
Copy link
Owner

Hmm. Can you make a codesandbox reproduction for this? Sorry for the late response.

@ayebear
Copy link

ayebear commented Aug 14, 2021

I reproduced this same issue in 2.0.1 here: https://codesandbox.io/s/modest-robinson-tm1iy

You can also try changing buttermilk back to 1.1.2 in codesandbox, which fixes the issue. In the codesandbox browser view it looks like it's pushing the actual route to history but not rendering anything new. Hope you can get this fixed.

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

3 participants