Skip to content

Commit 3f5c0c9

Browse files
committed
feat(parser): support forwardRef
Closes #2
1 parent 8ac6820 commit 3f5c0c9

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.vscode/launch.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"request": "launch",
1010
"name": "Debug test",
1111
"program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
12-
"args": ["test/index.test.ts"]
12+
"args": ["test/index.test.ts"],
13+
"skipFiles": ["${workspaceFolder}/node_modules/**/*.js", "<node_internals>/**/*.js"]
1314
}
1415
]
1516
}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ npm install typescript-to-proptypes --save-dev
1818
| Function | :heavy_check_mark: |
1919
| Const functions | :heavy_check_mark: |
2020
| React.memo | :heavy_check_mark: |
21-
| React.ForwardRef | :x: |
21+
| React.ForwardRef | :heavy_check_mark: |
2222

2323
## License
2424

src/parser.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export function parseFromProgram(
114114
node.moduleSpecifier.text === 'react' &&
115115
node.importClause
116116
) {
117-
const imports = ['Component', 'PureComponent', 'memo'];
117+
const imports = ['Component', 'PureComponent', 'memo', 'forwardRef'];
118118

119119
// import x from 'react'
120120
if (node.importClause.name) {

0 commit comments

Comments
 (0)