Skip to content

Commit

Permalink
feat(parser): support forwardRef
Browse files Browse the repository at this point in the history
Closes #2
  • Loading branch information
merceyz committed Nov 16, 2019
1 parent 8ac6820 commit 3f5c0c9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"request": "launch",
"name": "Debug test",
"program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
"args": ["test/index.test.ts"]
"args": ["test/index.test.ts"],
"skipFiles": ["${workspaceFolder}/node_modules/**/*.js", "<node_internals>/**/*.js"]
}
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ npm install typescript-to-proptypes --save-dev
| Function | :heavy_check_mark: |
| Const functions | :heavy_check_mark: |
| React.memo | :heavy_check_mark: |
| React.ForwardRef | :x: |
| React.ForwardRef | :heavy_check_mark: |

## License

Expand Down
2 changes: 1 addition & 1 deletion src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export function parseFromProgram(
node.moduleSpecifier.text === 'react' &&
node.importClause
) {
const imports = ['Component', 'PureComponent', 'memo'];
const imports = ['Component', 'PureComponent', 'memo', 'forwardRef'];

// import x from 'react'
if (node.importClause.name) {
Expand Down

0 comments on commit 3f5c0c9

Please sign in to comment.