Skip to content

Conversation

@lulucatdev
Copy link
Contributor

Added a React Link component for Phoenix LiveView navigation to solve #36

The new Link component provides seamless navigation within Phoenix LiveView applications, supporting all LiveView navigation patterns:

  • href - Traditional browser navigation (full page reload)
  • patch - Patch current LiveView (calls handle_params)
  • navigate - Navigate to different LiveView (same live_session)
  • replace - Replace browser history instead of push
import { Link } from "live_react";

<Link href="/external">External Link</Link>
<Link patch="/same?tab=new">Patch Current LV</Link>
<Link navigate="/other">Navigate to Other LV</Link>
<Link navigate="/path" replace={true}>Replace History</Link>

@mrdotb
Copy link
Owner

mrdotb commented Jun 16, 2025

👋 Thank you for the pr.
It seems you forgot to commit the Link component and only added the example part.

@lulucatdev
Copy link
Contributor Author

Sorry for that. I've now added the commit that includes the Link component.

@mrdotb
Copy link
Owner

mrdotb commented Jun 16, 2025

I got a broken thing on http://localhost:4000/link-usage
image
image

Does it display correctly on your end ?

@lulucatdev
Copy link
Contributor Author

Missed a block class name in the button. Should be fixed now.
image

@mrdotb
Copy link
Owner

mrdotb commented Jun 22, 2025

Merged in #48

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

Successfully merging this pull request may close these issues.

2 participants