fix: hot can't do that

This commit is contained in:
cha0s 2020-12-01 02:52:37 -06:00
parent b1a42934df
commit e182c91d4c

View File

@ -1,16 +1,16 @@
import React from 'react';
import {render} from 'react-dom';
import {hot} from 'react-hot-loader';
// eslint-disable-next-line import/prefer-default-export
export const $$latus = {
hooks: {
'@latus/http/up': (plugins) => {
const modules = plugins.invoke('@latus/react/components');
const Components = plugins.invoke('@latus/react/components');
const heated = React.createElement(
hot(module)(React.Fragment),
React.Fragment,
{},
Object.entries(modules).map(([key, module]) => React.createElement(module, {key})),
Object.entries(Components)
.map(([key, Component]) => React.createElement(Component, {key})),
);
return render(heated, window.document.getElementById('root'));
},