Changelog
New updates and improvements
1.1.3 - 2022-11-15
Changed
- Fields
parentandviewPropsnow are notundefinedduring the first view render.
1.2.0 - 2022-12-26
Changed
- Fields
parentandviewPropsnow are notundefinedin the constructor of view model; - Due to the fact above
parentis no more observable; - Field
parentnow can be typed asnullin case there's no parent view model; - Returned functions of
viewandchildViewnow have 2 generics - for typing props and - forwarded ref. Now, it is better to use these generics rather explicitly typing props via
FC:
// Before
const View: FC<Props> = view(SomeViewModel)(() => (
<div />
));
// After
const View = view(SomeViewModel)<Props>(() => (
<div />
));- The README file is now consist of a minimal example. The documentation can be found on the
- website.
Removed
- Type
ViewWithRefwas removed. To type forwarded ref of view or child view you can now use - the second generic of these functions:
// Before
const View: ViewWithRef<HTMLDivElement, Props> = view(SomeViewModel)(() => (
forwardRef(() => <div />)
));
// After
const View = view(SomeViewModel)<Props, HTMLDivElement>(() => (
forwardRef(() => <div />)
));- Removed an idle render of view components for initializing
parentandviewPropsfields.
1.2.1 - 2023-01-08
Changed
- The size of the packages was reduces from 1.8Kb to 1.6Kb