1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Add router level support for rendering react componenent pages

This commit is contained in:
Bill Thornton 2021-05-27 15:34:27 -04:00
parent 4aa203c0c6
commit eb605615d1
6 changed files with 34 additions and 3 deletions

View file

@ -0,0 +1,13 @@
import React from 'react';
import ReactDOM from 'react-dom';
// TODO: Probably need to rehydrate on view restores
export default (view, params, { detail }) => {
if (detail.options?.pageComponent) {
import(/* webpackChunkName: "[request]" */ `./pages/${detail.options.pageComponent}`)
.then(({ default: component }) => {
ReactDOM.render(React.createElement(component), view);
});
}
};