Skip to content

Navigation Mixing Failed Context Propagation #400

Closed
@CalebMorris

Description

@CalebMorris

I am attempting to use the updated React-Router (0.9.2) with a website I am working on with React.
When using the mixin for a non-child component (A component that is loaded when an event is emitted in a different portion of the application) the context doesn't seem to propagate as expected and non of the mixin methods are usable.

Example log : Warning: Required context 'makePath' was not specified in 'MyThing'.

Looking at the React blog
http://facebook.github.io/react/blog/2014/02/20/react-v0.9.html#breaking-changes
I noticed the final element no longer allows using this.context as it is reserved for internals.

I'm not sure if this is directly related as I don't understand quite what you are doing in the mixin.

Am I misunderstanding the usage of this mixin?
Is there a workaround to pass the context to a component by one that doesn't own it?

Example Code:
Component that uses mixin.

var BS     = require('react-bootstrap');
var React  = require('react');
var Router = require('react-router');

React.createClass({
  displayName : 'MyThing',
  mixins : [ Router.Navigation ],
  goToPlace : function() {
    this.transitionTo('path', null, {
      preQual    : true,
      propertyId : this.props.propertyId,
    });
  },
  render : function() {
    return (
     <div>
        <BS.Button onClick={this.goToPlace}>
          Go There Now
        </BS.Button>
      </div>
    );
  }
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions