Lazily load trix

This commit is contained in:
Paul Chavard 2020-10-06 17:23:10 +02:00
parent 95eb907090
commit d8852c7dc5
4 changed files with 12 additions and 2 deletions

View file

@ -0,0 +1,6 @@
import 'trix';
import '@rails/actiontext';
export default function () {
return null;
}

View file

@ -0,0 +1,3 @@
import Loadable from '../components/Loadable';
export default Loadable(() => import('../components/Trix'));

View file

@ -1,8 +1,6 @@
import '../shared/polyfills';
import Rails from '@rails/ujs';
import * as ActiveStorage from '@rails/activestorage';
import 'trix';
import '@rails/actiontext';
import 'whatwg-fetch'; // window.fetch polyfill
import ReactRailsUJS from 'react_ujs';

View file

@ -1,3 +1,6 @@
-# Load Trix lazily, by using our React lazy-loader.
-# (Trix itself doesn't use React though)
= react_component('Trix')
= f.label :subject do
Objet de l'email