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

Feat: add support for React-Router with `<Link /> #657

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

andycall
Copy link
Member

@andycall andycall commented Sep 1, 2024

Add the following essential missing DOM features to make WebF work with React Router's element:

Added DOM Features:

  1. Event.preventDefault() for the element.
  2. Event.button property.

Demo React.js code:

import './App.css';
import React from 'react';

import { Link } from "react-router-dom";

export default function App() {
    return (
        <div>
            <h1>Bookkeeper</h1>
            <nav
                style={{
                    borderBottom: "solid 1px",
                    paddingBottom: "1rem",
                }}
            >
                <Link to="/about">About</Link> |{" "}
                <Link to="/detail">Detail</Link>
            </nav>
        </div>
    );
}

@andycall andycall force-pushed the feat/prevent_default branch 2 times, most recently from 2255309 to 5b97087 Compare October 10, 2024 03:02
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.

1 participant