-
Notifications
You must be signed in to change notification settings - Fork 12
Port 03 State From TS to JS (ES6 >ES6) Issue #4 #11
New issue
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
Port 03 State From TS to JS (ES6 >ES6) Issue #4 #11
Conversation
03 State/src/app.jsx
Outdated
| interface Props { | ||
| } | ||
|
|
||
| interface State { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interface is something valid in ES6?
03 State/src/app.jsx
Outdated
| userName : string; | ||
| } | ||
|
|
||
| export class App extends React.Component<Props, State> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this extends <> work fine in Es6?
| } | ||
|
|
||
| setUsernameState(event) { | ||
| // If the state gets more complex we should use object.assign |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this comment, SetState already does that, sorry it's my fault
03 State/src/hello.jsx
Outdated
| @@ -0,0 +1,7 @@ | |||
| import * as React from 'react'; | |||
|
|
|||
| export const HelloComponent = (props : {userName : string}) => { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are using .js, types should not apply, or are you using flow?
03 State/src/nameEdit.jsx
Outdated
| @@ -0,0 +1,10 @@ | |||
| import * as React from 'react'; | |||
|
|
|||
| export const NameEditComponent = (props : { userName : string, onChange : (event : any) => any }) => { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here, we are using types here, as far as I know ES6 is not typed, and I think we are not using other annotation, does this throws errors when transpiling (babel?)
|
I think I have fixed all problems :-/ ESLint was a great help! |
|
Any update on this PR? |
|
Everything is alright? |
|
I can see.still things like username :string is this valid es6? |
|
I've looked over the changed files and I don't see TS code. |
|
Sorry, my fault, looking at the wrong tab, apprving and merging as @vicmator or Rocío to update the issue. Good stuff!!! |
|
Thanks!!! |
Port 03 State From TS to JS (ES6 >ES6). This closes Lemoncode/react-by-sample-es6 #4