Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@oerlikon/routing

Package Overview
Dependencies
Maintainers
7
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oerlikon/routing

Provides simple react components for menu frame -> main frame routing inside your oerlikon app.

  • 1.0.0-alpha.4
  • unpublished
  • latest
  • npm
  • Socket score

Version published
Maintainers
7
Created
Source

@oerlikon/routing

Provides simple react components for menu frame -> main frame routing inside your oerlikon app.

Disclaimer: This module depends on react-router-dom. If you indent to use a different routing system in your app, this module is not for you.

explanation of terms

main frame: the main part of your app that is always visible to the user

menu frame: the sidebar menu that can be openend and cloapsed.

main frame usage

Ensure the <Router> is placed high in your main frame rendering tree.

import { Router } from '@oerlikon/routing';
import { render } from 'react-dom';

import App from './App';

render(
  <Router>
	  <App />
  </Router>,
	document.getElementById('root')
);

menu frame usage

There are two methods to use this module in your menu frame components:

  1. Use the <Link> component inside your menu by providing to as prop and a label as children.

    import React from 'react';
    import { Link } from '@oerlikon/routing';
    
    export const MyMenu = () => {
      return (
        <>
          <h1>This is my menu</h1>
          <Link to="/overview">Go to overview inside the main frame!</link>
        </>
      );
    };
    
  2. use the useRouting hook to programatically change the route.

    import React from 'react';
    import { useRouting } from '@oerlikon/routing';
    
    export const MyMenu = () => {
      const { pushPath } = useRouting();
      
      const handleButtonClick = () => {
        pushPath('/overview');
      };
      
      return (
        <>
          <h1>This is my menu</h1>
          <button type="button" onClick={handleButtonClick}>
            Go to overview inside the main frame!
          </button>
        </>
      );
    };
    

FAQs

Package last updated on 13 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc