Skip to content

Conversation

@maslowivan
Copy link

fix #264

Add setCustomHistory function, because customHistory is read-only when exports.
Router class now extendable, to extend it - simple copy its constructor without "Object.getPrototypeOf" condition.
Add export for canRoute, delegateLinkHandler, routeTo, customHistory, setCustomHistory.

Add setCustomHistory function, because customHistory is read-only when exports.
Router class now extendable, to extend it - simple copy its constructor without "Object.getPrototypeOf" condition.
Add export for canRoute, delegateLinkHandler, routeTo, customHistory, setCustomHistory.
This was referenced Jan 27, 2018
customHistory = props.history;
}
/** this condition allows to modify the constructor */
if (Object.getPrototypeOf(this.constructor).name === 'Component') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks when minified.

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.

Preact Router is not able to be extended

3 participants