Skip to content

Commit d9ad9d4

Browse files
committed
refactor!: remove deprecated mainContainerClassName prop
It was already deprecated in v4. You can use `containerProps` instead
1 parent 261c47e commit d9ad9d4

11 files changed

+12
-30
lines changed

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ You can customize almost everything based on your needs. Please navigate to [Pro
8484
| editButtonClassName | string | No | | Custom class name for edit button. |
8585
| viewContainerClassName | string | No | | Custom class name for the container in `view` mode.[See here](https://alioguzhan.github.io/react-editext/#custom-classes-for-containers) |
8686
| editContainerClassName | string | No | | Custom class name for the container in edit mode. Will be set to `viewContainerClassName` if you set it and omit this. See [here](https://alioguzhan.github.io/react-editext/#custom-classes-for-containers) |
87-
| mainContainerClassName | string | No | | `deprecated`. Custom class name for the top-level main container. See [here](https://alioguzhan.github.io/react-editext/#custom-classes-for-containers) |
8887
| hideIcons | bool | No | `false` | Set it to `true` if you don't want to see default icons on action buttons. See Examples page for more details. |
8988
| buttonsAlign | string | No | `after` | Set this to `before` if you want to locate action buttons before the input instead of after it. See [here](https://alioguzhan.github.io/react-editext/#change-buttons-location). |
9089
| editOnViewClick | bool | No | `false` | Set it to `true` if you want clicking on the view to activate the editor. |

dist/index.d.ts

-5
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ export interface EdiTextProps {
110110
* Will be set to viewContainerClassName if you set it and omit this.
111111
*/
112112
editContainerClassName?: string;
113-
/**
114-
* Custom class name for the top-level main container.
115-
* @deprecated please use `containerProps` instead of this
116-
*/
117-
mainContainerClassName?: string;
118113
/**
119114
* Set it to `true` if you want clicking on the view to activate the editor.
120115
* @default false

dist/index.es.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.es.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

+3-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eslint.config.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default [
6565
'react-hooks/exhaustive-deps': 'warn',
6666
'react/react-in-jsx-scope': 'off',
6767
'react/no-unescaped-entities': 'off',
68+
'react/no-unknown-property': 'off',
6869
},
6970
},
7071
];
71-

src/index.spec.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ test('custom class names and button contents are working', () => {
302302
editButtonClassName={editButtonClassName}
303303
viewContainerClassName={viewContainerClassName}
304304
editContainerClassName={editContainerClassName}
305-
mainContainerClassName={mainContainerClassName}
305+
containerProps={{ className: mainContainerClassName }}
306306
value={VALUE}
307307
onSave={() => false}
308308
/>
@@ -316,9 +316,7 @@ test('custom class names and button contents are working', () => {
316316
expect(
317317
container.querySelector(`div.${mainContainerClassName}`)
318318
).toBeInTheDocument();
319-
expect(
320-
container.querySelector(`div.${mainContainerClassName}`)
321-
).toBeInTheDocument();
319+
322320
const button = container.querySelector('[editext="edit-button"]');
323321
expect(button?.textContent).toBe(editButtonContent);
324322
button && fireEvent.click(button, new MouseEvent('click'));

src/index.tsx

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable react/prop-types */
21
import React, {
32
ChangeEvent,
43
FocusEvent,
@@ -156,11 +155,6 @@ export interface EdiTextProps {
156155
* Will be set to viewContainerClassName if you set it and omit this.
157156
*/
158157
editContainerClassName?: string;
159-
/**
160-
* Custom class name for the top-level main container.
161-
* @deprecated please use `containerProps` instead of this
162-
*/
163-
mainContainerClassName?: string;
164158
/**
165159
* Set it to `true` if you want clicking on the view to activate the editor.
166160
* @default false
@@ -557,9 +551,7 @@ function EdiText(props: EdiTextProps) {
557551

558552
const mode = editingInternal ? _renderEditingMode() : _renderViewMode();
559553
const clsName = classnames(
560-
props.containerProps?.className ||
561-
props.mainContainerClassName ||
562-
styles.Editext__main_container,
554+
props.containerProps?.className || styles.Editext__main_container,
563555
props.className
564556
);
565557
return (

0 commit comments

Comments
 (0)