Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- rails webpacker:install:typescript
- Add "allowSyntheticDefaultImports": true to tsconfig - Convert component to tsx and FC component - yarn remove babel-plugin-transform-react-remove-prop-types prop-types
- Loading branch information
1 parent
7bb2358
commit 655dc59
Showing
9 changed files
with
112 additions
and
66 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
import React from "react" | ||
|
||
type Props = { | ||
greeting: string | ||
} | ||
|
||
const HelloWorld: React.VFC<Props> = ({ greeting }) => { | ||
return <> | ||
Greetingts: {greeting} | ||
</> | ||
} | ||
export default HelloWorld |
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
// Run this example by adding <%= javascript_pack_tag 'hello_typescript' %> to the head of your layout file, | ||
// like app/views/layouts/application.html.erb. | ||
|
||
console.log('Hello world from typescript'); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,8 @@ default: &default | |
- .woff2 | ||
|
||
extensions: | ||
- .tsx | ||
- .ts | ||
- .jsx | ||
- .mjs | ||
- .js | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"compilerOptions": { | ||
"declaration": false, | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"lib": [ | ||
"es6", | ||
"dom" | ||
], | ||
"module": "es6", | ||
"moduleResolution": "node", | ||
"sourceMap": true, | ||
"target": "es5", | ||
"jsx": "react", | ||
"noEmit": true, | ||
"allowSyntheticDefaultImports": true | ||
}, | ||
"exclude": [ | ||
"**/*.spec.ts", | ||
"node_modules", | ||
"vendor", | ||
"public" | ||
], | ||
"compileOnSave": false | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.