-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate typescript for SVGs when using svgr and typescript option (#…
…8411) Co-authored-by: Niklas Mischkulnig <[email protected]>
- Loading branch information
Showing
8 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
packages/core/integration-tests/test/integration/svg-react-typescript/.svgrrc.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"typescript": true | ||
} |
14 changes: 14 additions & 0 deletions
14
packages/core/integration-tests/test/integration/svg-react-typescript/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
packages/core/integration-tests/test/integration/svg-react-typescript/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<img src="icon.svg" /> |
8 changes: 8 additions & 0 deletions
8
packages/core/integration-tests/test/integration/svg-react-typescript/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"source": "react.ts", | ||
"main": "icons.js", | ||
"types": "types.d.ts", | ||
"dependencies": { | ||
"react": "*" | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
packages/core/integration-tests/test/integration/svg-react-typescript/react.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
interface SVGRComponent | ||
extends React.StatelessComponent<React.SVGAttributes<SVGElement>> {} | ||
|
||
import React from 'react'; | ||
import ReactIcon from './icon.svg'; | ||
const Icon:SVGRComponent = ReactIcon; | ||
export default Icon; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters