Releases: XantreDev/react-fast-hoc
Releases · XantreDev/react-fast-hoc
[email protected]
[email protected]
Patch Changes
-
32e18c1: Fixed wrapping into hoc in case of nested
React.memo
Resolves: #17const Component = transformProps( React.memo( React.memo((props) => { console.log(props); // prev: { c: 30 }, now: { a: 10, b: 20, c: 30 } return null; }) ), (props) => ({ ...props, a: 10, b: 20 }) ); root.render(<Component c={30} />);
[email protected]
Minor Changes
-
d2cc312: Deprecated
mimicToNewComponent
and make default to false (true was before) -
8680658: Made displayName editable for each transformed component:
const _ = transformProps(A, (props) => props, { displayNameTransform: { value: (name) => name + "C", type: "rewrite-dynamic", }, }); expect(_.displayName).toBe("AC"); _.displayName = "D"; expect(_.displayName).toBe("D");
-
d2cc312: Added new syntax for name rewriting, old one is deprecated and will be removed soon
Static name rewrite
transformProps(B, (props) => props, { displayNameTransform: { type: "rewrite", value: "D", }, }); transformProps(A, (props) => props, { displayNameTransform: { type: "prefix", value: "CBC", }, });
Dynamic name rewrite
transformProps(A, (props) => props, { displayNameTransform: { value: (name) => name + "C", type: "rewrite-dynamic", }, });
-
f057209: Added support for components wrapped with
React.lazy
[email protected]
Patch Changes
- 3537998: Fix
wrapIntoProxy
type issue
[email protected]
Minor Changes
- 309bcff: Add oportunity to transform component directly, not only props
[email protected]
Patch Changes
- cc1dfd3: Moved build deps to devDependencies, and fixed type inference
[email protected]
Patch Changes
- 1fb53bb: Changed type to module
[email protected]
Patch Changes
- 5d82ea0: Trying to really add treeshaking
[email protected]
[email protected]
Patch Changes
- 780a15b: Updated readme