Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Input
✓ import Input from 'rc-input';
✗ import { Input } from 'rc-input';
The primary Input component is exported as a default export.
Input.TextArea
✓ import Input from 'rc-input';
// ...
<Input.TextArea />
✗ import { TextArea } from 'rc-input';
Following a refactor, textarea functionality is often accessed via a static property on the default Input component, not as a separate named export.
CommonJS require
✓ const Input = require('rc-input').default;
✗ const Input = require('rc-input');
For CommonJS environments, the default export is accessed via the `.default` property.
This example demonstrates basic usage of the Input component, including a clearable input, a textarea, and a readonly input.
import Input from 'rc-input';
import { createRoot } from 'react-dom/client';
const App = () => (
<div>
<Input placeholder="Basic input" allowClear />
<br />
<Input.TextArea placeholder="Textarea input" rows={4} />
<br />
<Input value="Readonly input" readOnly />
</div>
);
const mountNode = document.getElementById('root');
if (mountNode) {
const root = createRoot(mountNode);
root.render(<App />);
} else {
console.error('Mount node not found!');
}
Debug
Known issues
breakingThe package underwent a confusing naming change attempt. At one point, the project intended to rename from `rc-input` to `@rc-component/input`. While a separate `@rc-component/input` package exists with its own `1.x` release line, the original `rc-input` package has continued independent development and is now at a higher version (e.g., 1.8.0 vs. 1.3.0 for `@rc-component/input`). Developers should strictly use `rc-input` for the actively maintained version.fixEnsure you `npm install rc-input` and update all `import` or `require` statements to reference `rc-input` instead of `@rc-component/input`.
affects: All versions where confusion exists (broadly since `@rc-component/input@1.2.0`)
breakingTextarea functionality, previously potentially handled by a separate `rc-textarea` package or distinct component, was merged into `rc-input` (noted in `@rc-component/input@1.3.0`, which should apply to the `rc-input` line as well). This change consolidates input and textarea logic. Users of `rc-textarea` or specific textarea APIs should review the `rc-input` documentation for the new recommended way to implement text areas.fixMigrate usage from `rc-textarea` or old textarea patterns to use `Input.TextArea` or equivalent functionality exposed by `rc-input`.
affects: Potentially `>=1.3.0` for `@rc-component/input` and likely `rc-input` versions incorporating this refactor (implied `v1.8.0`).
gotchaThe README contains incorrect NPM links pointing to `rc-select` instead of `rc-input` for bundle size and download stats. This is a documentation error and does not affect package functionality, but can be misleading when checking package popularity or size.fixAlways verify package details directly on npmjs.com/package/rc-input for accurate information.
affects: All versions, as it's a documentation issue.
Errors
Common errors & fixes
Module not found: Can't resolve '@rc-component/input'
Attempting to import from `@rc-component/input` when the actively maintained and installed package is `rc-input`.
fixChange your import statements from `import ... from '@rc-component/input'` to `import ... from 'rc-input'`.
TypeError: (0, _rc_input.default) is not a function
Attempting to use `require('rc-input')` directly as a function in CommonJS, when `rc-input` exports its main component as a default export.
fixAccess the default export correctly: `const Input = require('rc-input').default;` TypeError: Cannot read properties of undefined (reading 'TextArea')
Attempting to use `Input.TextArea` without `Input` being correctly imported or when the installed version of `rc-input` does not expose `TextArea` in this manner.
fixEnsure `import Input from 'rc-input';` is correctly placed and that your `rc-input` version supports the `Input.TextArea` static component. If it doesn't, you might need to use a separate `rc-textarea` package or upgrade `rc-input`.
Audit
Dependencies
reactrequiredPeer dependency for React component functionality.
react-domrequiredPeer dependency for React component rendering.