mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 11:04:41 +08:00
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:
parent
914b94b62d
commit
1a928ca0ab
@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user