Skip to content

Releases: patrickjames242/react-extend-components

v1.2.3

06 Apr 15:20
Compare
Choose a tag to compare

This release fixes a few bugs.

  • Fixes bugs having to do with refs for child components
  • Adjusts the way a result component communicates with its inner components to ensure that inner components can only interact with the result component that produced them. Previously the same context was used to accomplish this, so if you wrapped your inner components with some other result component, the inner components would see the wrong context value.

v1.2.2

04 Apr 01:04
Compare
Choose a tag to compare

Fixed bug where nesting extended components would cause the components to use the wrong communication context value.

v1.2.1

03 Apr 20:59
Compare
Choose a tag to compare

Added a few comments for prop helper functions.

v1.2.0

03 Apr 11:34
Compare
Choose a tag to compare

This release adds more features to the library.

  • You can now set a global merge function using the MergeFunctionProvider at the top of your react tree.
  • You can now add child components to your components that users automatically have the ability to customize.
  • The default way users will use the library will be an extend function, and they have the ability to create their own customized extend function if they so desire.
  • Add ability to specify a custom merge function for a single additional component when creating a custom extend function.

v1.0.7

22 Mar 14:41
Compare
Choose a tag to compare

This release adjusts the names of a few types and function parameters to make more sense in relation to their actual function.

v1.0.6

22 Mar 14:37
Compare
Choose a tag to compare

This release improves the way you can 'pluck' props that were passed to the outer component.

Instead of plucking props with a pluck function and having to specify prop names twice...

const MyComponent = extendComponent('div')<{
   name: string
}>((Div, props) => {
   const { name } = props.pluck('name');
   return <Div>{name}</Div>
});

...you can now destructure props directly on the props object.

const MyComponent = extendComponent('div')<{
   name: string
}>((Div, { name }) => {
   return <Div>{name}</Div>
});

The library will automatically detect which props you're using within the component. It does this by providing you with a new object with getters for all of the props. The getters notify the library of which props you access in the component.

You can now access all the prop helper functions with the third argument of the render function.

const MyComponent = extendComponent('div')((Div, _, helpers) => {
   const peekedProps = helpers.peek();
   const pluckedProps = helpers.pluck('onClick');
   const detectedPluckedProps = helpers.detectPlucked();
   return <Div></Div>
});

v1.0.5

20 Mar 22:26
Compare
Choose a tag to compare

This release changes the names of various functions to use the verbiage of 'extend components' rather than 'component builder'. This is so the functions make more sense in relation to the title of the package. The major changes are listed below.

  • createComponentBuilderGroup -> createComponentExtenderGroup
  • createComponentBuilderGetter -> extendComponent

v1.0.4

19 Mar 20:50
Compare
Choose a tag to compare

This release adjusts the functionality of the default merge function in the following ways

  • The outer props now override the inner props by default (with the exception of special props like className, style, etc)
  • The merging of the children prop is now handled within the merge function
  • Previously if an outer style attribute (like color, backgroundColor etc.) was explicitly set to undefined, it would override the corresponding inner style attribute even if those were set to actual values. This has been fixed. The bug also existed with the way top-level props were merged, which has also been accounted for in the new implementation.

v1.0.3

13 Mar 01:10
Compare
Choose a tag to compare

This release fixes an issue where refs literally wouldn't work at all if you added a ref for the outer component as well as the inner component at the same time 🥴

v1.0.2

12 Mar 03:16
Compare
Choose a tag to compare
version bump