Skip to content

Latest commit

 

History

History
74 lines (54 loc) · 1.93 KB

README.md

File metadata and controls

74 lines (54 loc) · 1.93 KB

@unitools/link [ALPHA]

This is the official documentation of the @unitools/link package.

For Next.js

Installation

npm install @unitools/link

or

yarn add @unitools/link

Add module resolver to your next.config.js file.

// next.config.js

module.exports = {
  webpack(config) {
    config.resolve.alias["@unitools/link"] = "next/link";
    return config;
  },
};

For Expo

Installation

Install @unitools/link and the peer dependency @react-navigation/native.

npm install @unitools/link @react-navigation/native

or

yarn add @unitools/link @react-navigation/native

Usage

import Link from "@unitools/link";

export default function Home() {
  return (
    <View>
      <Link href="/about">
        <Text>About</Text>
      </Link>
    </View>
  );
}

Props

Prop Type Default Description status Support Status
href String or Object href url required
replace Boolean Replace the current history state -
scroll Boolean - -
prefetch Boolean If true, this will prefetch the url -
passHref Boolean Forces Link to send the href property to its child -
shallow Boolean - -
locale Boolean If true, the active locale is automatically -