import React from 'react'; import { Router, Link, Navigation } from 'react-router'; export default class ResourceCard extends React.Component { render() { return ( <div onClick={this.routeHandler.bind(this)}> LINK </div> ); } routeHandler(){ this.transitionTo('someRoute', {objectId: 'asdf'}) } }
I can not understand what happened? I get an error: Uncaught TypeError: this.transitionTo is not a function
I tried everything I found in the docs or in gitHub issues:
this.transitionTo('someRoute', {objectId: 'asdf'}) this.context.transitionTo('someRoute', {objectId: 'asdf'}) this.context.route.transitionTo('someRoute', {objectId: 'asdf'}) etc.
the route and parameter are correct, in this case it works fine:
<Link to="'someRoute" params={{objectId: 'asdf}}
ps reaction-router, reaction and other libraries updated
source share