All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Fields
parent
andviewProps
now are notundefined
during the first view render.
- Fields
parent
andviewProps
now are notundefined
in the constructor of view model; - Due to the fact above
parent
is no more observable; - Field
parent
now can be typed asnull
in case there's no parent view model; - Returned functions of
view
andchildView
now have 2 generics - for typing props and forwarded ref. Now, it is better to use these generics rather explicitly typing props viaFC
:
// 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.
- Type
ViewWithRef
was 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
parent
andviewProps
fields.
- The size of the packages was reduces from 1.8Kb to 1.6Kb