3 ms·
I've been using preact with tsx and inline styles. Every component Is a es6 module that declares it's imports and exports. I have a theme.ts containing my theme
by nojvek 10y ago
I've been using preact with tsx and inline styles. Every component Is a es6 module that declares it's imports and exports. I have a theme.ts containing my theme variables. There are watchable models. Only views contain tsx and css as js. Views import a controller and mediate events to them. Controllers know nothing about the view and they are the only ones that can modify the model.
My application contains a single index.html with entry point to my js bundle, empty body tag and no css.
Everything is loaded as needed, encapsulated as modules. The simplicity is just amazing .
The way I think about it is react like thinking offers me the most semantic compression in my code.
- mercer 10y agoI tried getting Preact to work with webpack and TypeScript, but I ran into issues with aliasing (which AFAIK isn't possible in TypeScript). How did you solve this issue? (I use webpack because it now supports tree-shaking)