Bump React from 16.14.0 to 18.1.0
This commit is contained in:
parent
f804c00920
commit
83b21e90d2
226 changed files with 531 additions and 610 deletions
|
@ -1,6 +1,7 @@
|
|||
import './public-path';
|
||||
|
||||
import { delegate } from '@rails/ujs';
|
||||
import ready from '../mastodon/ready';
|
||||
import ready from 'mastodon/ready';
|
||||
|
||||
const batchCheckboxClassName = '.batch-checkbox input[type="checkbox"]';
|
||||
|
||||
|
@ -110,21 +111,23 @@ ready(() => {
|
|||
}
|
||||
});
|
||||
|
||||
const React = require('react');
|
||||
const ReactDOM = require('react-dom');
|
||||
const { createRoot } = require('react-dom/client');
|
||||
|
||||
[].forEach.call(document.querySelectorAll('[data-admin-component]'), element => {
|
||||
const componentName = element.getAttribute('data-admin-component');
|
||||
const { locale, ...componentProps } = JSON.parse(element.getAttribute('data-props'));
|
||||
|
||||
import('../mastodon/containers/admin_component').then(({ default: AdminComponent }) => {
|
||||
return import('../mastodon/components/admin/' + componentName).then(({ default: Component }) => {
|
||||
ReactDOM.render((
|
||||
<AdminComponent locale={locale}>
|
||||
<Component {...componentProps} />
|
||||
</AdminComponent>
|
||||
), element);
|
||||
});
|
||||
Promise.all([
|
||||
import('mastodon/containers/admin_component'),
|
||||
import('mastodon/components/admin/' + componentName),
|
||||
]).then(({ default: AdminComponent }, { default: Component }) => {
|
||||
const root = createRoot(element);
|
||||
|
||||
root.render((
|
||||
<AdminComponent locale={locale}>
|
||||
<Component {...componentProps} />
|
||||
</AdminComponent>
|
||||
));
|
||||
}).catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue