We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying out the new TypeScript support. But I can't add public or private to a method
public
private
System: OS: macOS High Sierra 10.13.5 CPU: x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz Binaries: Node: 10.4.1 - ~/.nvm/versions/node/v10.4.1/bin/node Yarn: 1.10.1 - /usr/local/bin/yarn npm: 6.1.0 - ~/.nvm/versions/node/v10.4.1/bin/npm Browsers: Chrome: 70.0.3538.77 Safari: 11.1.1 npmPackages: @types/react: ^16.4.18 => 16.4.18 @types/react-dom: ^16.0.9 => 16.0.9 react: ^16.6.0 => 16.6.0 react-dom: ^16.6.0 => 16.6.0 react-scripts: 2.0.5 => 2.0.5 npmGlobalPackages: create-react-app: 2.0.4
Since typescript support is not yet released to npm I followed @brunolemos steps to clone CRA and link react-scripts. Then:
react-scripts
create-react-app cra-ts-test
cd cra-ts-test
yarn add typescript @types/react @types/react-dom @types/jest
yarn link react-scripts
index.js
index.tsx
App.js
App.tsx
render() {
yarn start
It should compile and work
Failed to compile
./src/App.tsx SyntaxError: /Users/mikel/Projects/Lab/cra-ts-test/src/App.tsx: Unexpected token (6:9) 4 | 5 | class App extends Component { > 6 | public render() { | ^ 7 | return ( 8 | <div className="App"> 9 | <header className="App-header">
https://github.com/MikelArnaiz/cra-ts-test
(make sure to yarn link react-scripts to the latest version with TS support)
The text was updated successfully, but these errors were encountered:
It works fine. Please use this new method instead of yarn link:
npx create-react-app@next app-name --scripts-version=2.0.6-next.c662dfb0 --typescript
Sorry, something went wrong.
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
I'm trying out the new TypeScript support. But I can't add

public
orprivate
to a methodEnvironment
System:
OS: macOS High Sierra 10.13.5
CPU: x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Binaries:
Node: 10.4.1 - ~/.nvm/versions/node/v10.4.1/bin/node
Yarn: 1.10.1 - /usr/local/bin/yarn
npm: 6.1.0 - ~/.nvm/versions/node/v10.4.1/bin/npm
Browsers:
Chrome: 70.0.3538.77
Safari: 11.1.1
npmPackages:
@types/react: ^16.4.18 => 16.4.18
@types/react-dom: ^16.0.9 => 16.0.9
react: ^16.6.0 => 16.6.0
react-dom: ^16.6.0 => 16.6.0
react-scripts: 2.0.5 => 2.0.5
npmGlobalPackages:
create-react-app: 2.0.4
Steps to Reproduce
Since typescript support is not yet released to npm I followed @brunolemos steps to clone CRA and link
react-scripts
. Then:create-react-app cra-ts-test
cd cra-ts-test
yarn add typescript @types/react @types/react-dom @types/jest
yarn link react-scripts
index.js
toindex.tsx
App.js
toApp.tsx
App.tsx
addedpublic
in front ofrender() {
yarn start
Expected Behavior
It should compile and work
Actual Behavior
Failed to compile
Reproducible Demo
https://github.com/MikelArnaiz/cra-ts-test
(make sure to
yarn link react-scripts
to the latest version with TS support)The text was updated successfully, but these errors were encountered: