Fix admin navigation not rendering

Not sure why this started happening now, but the admin navigation
dropdown wasn't receiving its children properly. This commit fixes a
flaw in our Mithril patch and allows an array of children to be passed
in the normal JSX way, rather than as an attribute.
This commit is contained in:
Toby Zerner 2017-11-05 16:12:26 +10:30
parent 914b94b62d
commit 1a928ca0ab
2 changed files with 9 additions and 4 deletions

View File

@ -18,9 +18,9 @@ export default class AdminNav extends Component {
return (
<SelectDropdown
className="AdminNav App-titleControl"
buttonClassName="Button"
children={this.items().toArray()}
/>
buttonClassName="Button">
{this.items().toArray()}
</SelectDropdown>
);
}

View File

@ -5,7 +5,12 @@ export default function patchMithril(global) {
const m = function(comp, ...args) {
if (comp.prototype && comp.prototype instanceof Component) {
return comp.component(args[0], args.slice(1));
let children = args.slice(1);
if (children.length === 1 && Array.isArray(children[0])) {
children = children[0]
}
return comp.component(args[0], children);
}
const node = mo.apply(this, arguments);