From 63af48a4431d9ced5865cdbda8c5fb75bc6cfb30 Mon Sep 17 00:00:00 2001 From: Serbanescu Date: Fri, 21 Apr 2017 16:57:32 +0100 Subject: [PATCH] feat: allow teleports to take active state explicitly via props --- blocks/teleport.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/blocks/teleport.js b/blocks/teleport.js index 280ec8e..1167af1 100644 --- a/blocks/teleport.js +++ b/blocks/teleport.js @@ -16,7 +16,8 @@ export default class Teleport extends Component { styleHover, title, to, ...rest } = this.props const { isActive, navigate, route } = this.context - const active = isActive(to, loose) + const isExplicitlyActive = this.props.isActive; + const active = typeof isExplicitlyActive === 'boolean' && isExplicitlyActive || isActive(to, loose) const href = normaliseUri(`${route.context}${to}`) let inlineStyle = ''