3 ms·
Its like 2 weeks since I had to grasp react, fluentui, react hook forms, webpack and a little more when I started using modules and even more when I used typesc
by jve 4y ago
Its like 2 weeks since I had to grasp react, fluentui, react hook forms, webpack and a little more when I started using modules and even more when I used typescript.
React clicked really fast, documentation new and old, articles helped get on track really fast.
Wiring that all together and taming CRA (Create-react-app) with react-app-rewired to add stuff to webpack, like adding libraries to behave like modules that are NOT modules, packing all with scripts into single html, understanding where are boundaries between fluentui and react (both new to me), setting up monorepo because I separate reusable components from app itself and libs, applying css which I am bad at and stuff like that took more time... complexity just explodes, but less "mental effort" overall achieved by having streamlined build, reusable stuff etc.
Otherwise I feel that building app with react takes a lot of "mental effort" away, because you develop a component in isolation which feels simple and when you use that component you don't think about implementation details - it is nicely abstracted away and things just work.
Ah, yes, and I'm lucky I got the signal that functional components are way to go and the only place I had to use a small class component when I want to have a component variant for existing class based component from FluentUi where generic types are important and used within `onRenderItem` and various methods:
> class LookupBaseInternal extends BasePicker<ILookupResultProps, ILookupPropsInternal> {}
- jve 4y agoOh, here is another 1 I caught: > There is currently no way to write an error boundary as a function component. However, you don’t have to write the error boundary class yourself. For example, you can use react-error-boundary instead. https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary https://react.dev/reference/react/Component#catching-renderi...
- IceDane 4y agoJust FYI - I would not use CRA. Even the react maintainers basically recommend you don't use it, since it's not really up to date with best principles, and they might eventually change it so that it becomes a wizard that lets you choose between other more modern choices like nextjs or vite. You probably want to look at vite for a more direct alternative to CRA. No need for things like -rewired, and it's probably 10x faster than CRA.
- solarkraft 4y agoBack when I did an Angular project, throughout the day Webpack would fill up my RAM so hard that my M1 Macbook (with 8GB of RAM, connected to a 4K display) would eventually crawl to a halt and crash. No such issues with Vite. It feels super light weight, snappy as hell and can run forever.
- Cthulhu_ 4y agoThe new docs make no mention of create-react-app anymore either: https://react.dev/learn/start-a-new-react-project https://react.dev/learn/start-a-new-react-project
- Aduket 4y agoWow, your writing skill is awful. Building a sentence with 50 words?!?! And not using even a single comma?!?! Your brain must be working differently