@selfcommunity/react-core
Version:
React Core Components useful for integrating UI Community components (react-ui).
34 lines (27 loc) • 872 B
TypeScript
import React from 'react';
/**
:::info
This component is used to navigate through the application.
:::
## Usage
In order to use router you need to import this components first:
```jsx
import {SCRoutingContextType, useSCRouting, Link, SCRoutes} from '@selfcommunity/react-core';
````
:::tip Usage Example:
```jsx
const scRoutingContext: SCRoutingContextType = useSCRouting();
<Button component={Link} to={scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, {id: user.id})>Go to profile</Button>
````
**or**
```jsx
const scRoutingContext: SCRoutingContextType = useSCRouting();
<Link to={scRoutingContext.url('profile', {id: user.id})}>Go to profile</Link>
````
:::
*/
declare const _default: React.ForwardRefExoticComponent<Pick<{
[x: string]: any;
children: any;
}, string | number> & React.RefAttributes<unknown>>;
export default _default;