buttermilk icon indicating copy to clipboard operation
buttermilk copied to clipboard

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

Open andrekovac opened this issue 4 years ago • 2 comments

The following code worked in [email protected] but does not work in [email protected] 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..

andrekovac avatar Sep 04 '19 21:09 andrekovac

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

quantizor avatar Oct 20 '19 18:10 quantizor

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.

ayebear avatar Aug 14 '21 02:08 ayebear