🔥Migration Guide to v2.0.0

Installation

To install the latest version, run:

npm install react-easy-edit@latest

Or, if you're using yarn:

yarn add react-easy-edit@latest

Migration Steps

Update Prop Names:

  • Replace attributes with inputAttributes.

  • Replace allowEdit with editable.

  • Replace editMode with isEditing.

Breaking Changes

1. Prop Renaming

a. attributesinputAttributes

Old Usage:

<EasyEdit
  attributes={{ placeholder: 'Enter text' }}
  value={value}
  onSave={handleSave}
/>

New Usage:

<EasyEdit
  inputAttributes={{ placeholder: 'Enter text' }}
  value={value}
  onSave={handleSave}
/>

b. allowEditeditable

Old Usage:

<EasyEdit
  allowEdit={true}
  value={value}
  onSave={handleSave}
/>

New Usage:

<EasyEdit
  editable={true}
  value={value}
  onSave={handleSave}
/>

c. editModeisEditing

Old Usage:

<EasyEdit
  editMode={true}
  value={value}
  onSave={handleSave}
/>

New Usage:

<EasyEdit
  isEditing={true}
  value={value}
  onSave={handleSave}
/>

Enhancements

  • Functional Components: The library has been completely rewritten using functional components, providing better performance and compatibility with React hooks.

  • Improved Testing: Unit tests have been updated to reflect the latest changes, achieving 100% test coverage for increased reliability.

Last updated