atlassian / atlassian/extract-react-types
Props not being extracted when using both memo and forward ref
- Dominant language
- JavaScript
- Stars
- 188
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Description
Doesn't work:
```ts
import { TextfieldProps } from './types';
const Textfield = forwardRef((props: TextfieldProps, ref) => {
^^^^^^^^^^^^^^^ not extracted
return ;
});
Textfield.displayName = 'Textfield';
export default memo(Textfield);
```
Doesn't work:
```ts
import { TextfieldProps } from './types';
const Textfield = forwardRef((props: TextfieldProps, ref) => {
^^^^^^^^^^^^^^^ not extracted
return ;
});
Textfield.displayName = 'Textfield';
export default memo(Textfield);
```
Works
```ts
import { TextfieldProps } from './types';
const Textfield = forwardRef((props: TextfieldProps, ref) => {
return ;
});
Textfield.displayName = 'Textfield';
export default memo(Textfield);
^^^^^^^^^^^^^^^ extracts, but now missing ref prop in the component types
```
Contributor guide
Assessment
This issue has not been assessed yet.