Skip to content

Conversation

@wieseljonas
Copy link

This is very useful for me as I use Gateway for my navigation and it enables me to change navigation items from every every route or have the default value displayes

@srph
Copy link

srph commented May 4, 2019

For the mean time, if anybody's interested, I made a component that allows this instead.

import * as React from 'react'
import { GatewayDest } from 'react-gateway'

function GatewayDestWithFallback(props) {
  return (
    <GatewayDest name={props.name} component={Inner} fallback={props.fallback}>
      {props.children}
    </GatewayDest>
  )
}

function Inner(props) {
  return props.children || props.fallback || <div />
}

export default GatewayDestWithFallback

Usage

 <GatewayDestWithFallback name="my-top-nav-title" fallback={<Logo />} />

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.

2 participants