Skip to content
4 changes: 1 addition & 3 deletions docs/examples/textarea-allow-clear.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/* eslint-disable no-console */
import Input from '@rc-component/input';
import { TextArea } from '@rc-component/input';
import React, { useState, type ChangeEvent } from 'react';

const TextArea = Input.TextArea;

export default function App() {
const [value, setValue] = useState('hello\nworld');

Expand Down
4 changes: 1 addition & 3 deletions docs/examples/textarea-auto-size.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/* eslint-disable no-console */
import Input, { type TextAreaProps } from '@rc-component/input';
import { TextArea, type TextAreaProps } from '@rc-component/input';
import React, { useState, type ChangeEvent } from 'react';

const TextArea = Input.TextArea;

export default function App() {
const [value, setValue] = useState('hello\nworld');

Expand Down
4 changes: 1 addition & 3 deletions docs/examples/textarea-basic.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/* eslint-disable no-console */
import Input, { type TextAreaProps } from '@rc-component/input';
import { TextArea, type TextAreaProps } from '@rc-component/input';
import React, { useState, type ChangeEvent, type KeyboardEvent } from 'react';

const TextArea = Input.TextArea;

export default function App() {
const [value, setValue] = useState('');

Expand Down
4 changes: 1 addition & 3 deletions docs/examples/textarea-show-count.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/* eslint-disable no-console */
import Input from '@rc-component/input';
import { TextArea } from '@rc-component/input';
import React, { useState, type ChangeEvent } from 'react';
import '../../assets/index.less';

const TextArea = Input.TextArea;

export default function App() {
const [value, setValue] = useState('hello\nworld');

Expand Down
4 changes: 1 addition & 3 deletions tests/TextArea.allowClear.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { fireEvent, render } from '@testing-library/react';
import type { ChangeEventHandler, TextareaHTMLAttributes } from 'react';
import React from 'react';
import Input from '../src';

const TextArea = Input.TextArea;
import { TextArea } from '../src';

describe('should support allowClear', () => {
it('should change type when click', () => {
Expand Down
4 changes: 1 addition & 3 deletions tests/TextArea.count.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { fireEvent, render } from '@testing-library/react';
import React from 'react';
import Input from '../src';

const TextArea = Input.TextArea;
import { TextArea } from '../src';

const getSegments = (val: string) => [...new Intl.Segmenter().segment(val)];

Expand Down
5 changes: 1 addition & 4 deletions tests/TextArea.focus.test.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// @ts-nocheck
import { fireEvent, render } from '@testing-library/react';
import React from 'react';
import Input from '../src';
import type { TextAreaRef } from '../src';

const TextArea = Input.TextArea;
import { TextArea, type TextAreaRef } from '../src';

describe('focus and blur', () => {
let focused = false;
Expand Down
4 changes: 1 addition & 3 deletions tests/TextArea.showCount.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { render } from '@testing-library/react';
import React from 'react';
import Input from '../src';

const TextArea = Input.TextArea;
import { TextArea } from '../src';

describe('should support showCount', () => {
it('maxLength', () => {
Expand Down
5 changes: 1 addition & 4 deletions tests/TextArea.test.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
// @ts-nocheck
import { fireEvent, render } from '@testing-library/react';
import React from 'react';
import Input from '../src';
import type { TextAreaProps, TextAreaRef } from '../src';
import { TextArea, type TextAreaProps, type TextAreaRef } from '../src';
import calculateAutoSizeStyle, {
calculateNodeStyling,
} from '../src/calculateNodeHeight';
import { triggerResize, wait } from './utils';

const TextArea = Input.TextArea;

describe('TextArea', () => {
const originalGetComputedStyle = window.getComputedStyle;
beforeAll(() => {
Expand Down