Khan / Khan/react-balance-text
Add Type Support
- Dominant language
- JavaScript
- Stars
- 34
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
This component does not naturally have type definitions for TypeScript. This is an old package and I do not expect changes, so I wanted to leave in a solution for users below.
If you are using this package you can add type support by creating a typescript declaration file.
```ts
// index.d.ts
declare module 'react-balance-text' {
const BalanceText: React.ComponentClass<{
children?: React.ReactNode,
className?: string,
style?: React.CSSProperties,
resize?: boolean,
}>;
export = BalanceText
}
```
Contributor guide
Research direction
Start from the proposed index.d.ts declaration and compare its BalanceText props with the package's exported component. Add the declaration so users receive TypeScript support, then verify that the package exposes the types without changing the existing component behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100