Open AndrewArlenHoneywell opened 4 years ago
Hello, please feel free to raise a PR
Thank you :) I will get someone on my team to make the relevant changes and raise a PR.
Hi LeonardoGentile , thank you .
PR has been raised . https://github.com/LeonardoGentile/react-mobx-router5/pull/13
My Armenian friend did something like this:
import {RouteView as BaseRouteView} from "react-mobx-router5";
class ErrorComponent extends React.Component {
render() {
return (
<div>
My custom component error. Syskius!
</div>
)
}
}
class RouteView extends BaseRouteView {
render() {
if (this.state.hasError) {
return <this.props.errorComponent {...this.props}/>;
}
return super.render();
}
}
class Channels extends React.Component {
render() {
const {route} = this.props;
return (
<RouteView
errorComponent={ErrorComponent}
route={route}
routes={routesMap}
routeNodeName={routeNodeName}
/>
)
}
}
My Armenian friend decided to go further: redefine render method of RouteView (in app.jsx
, for example)
import * as Rmr from "react-mobx-router5";
class ErrorComponent extends React.Component {
render() {
return (
<div>
My custom component error. Syskius!
</div>
)
}
}
const oldRender = Rmr.RouteView.prototype.render;
Rmr.RouteView.prototype.render = function () {
if (this.state.hasError) {
return <ErrorComponent {...this.props}/>;
}
return oldRender.apply(this);
};
Hi, I saw the PR got merged, is there a release version for this?
Hi. I have a requirement to replace the 'Something went wrong' message with a nicer looking view which is much more complex than a simple string. How would I go about doing this ?
Should I raise a PR for this change ?
Or should I be forking this project and maintaining my own version ?