UNPKG

react-link-preview

Version:

Wrap your React Router Link with the React Link Preview and feed it a component. You'll get a modal with a preview of that component on long-press and a regular link otherwise.

24 lines (20 loc) 583 B
import React from "react"; import { render } from "react-dom"; import { BrowserRouter, HashRouter, Route } from 'react-router-dom'; import "./styles.css"; // Components. import Home from 'src/sections/Home'; import PreviewMe from 'src/sections/PreviewMe'; function Demo() { return ( <div> <HashRouter> <div className="PageContainer"> <Route exact path="/" component={ Home } /> <Route exact path="/preview-me" component={ PreviewMe } /> </div> </HashRouter> </div> ); } render(<Demo />, document.getElementById("app"));