GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Parse and check type arguments on JSX opening and self-closing tags by weswigham · Pull Request #22415 · microsoft/TypeScript Conversation
Member
Allows, eg, <MyComponent<number> data={12} /> in Fixes #6395. Was there a list of things we were concerned wouldn't parse well? AFAIK, this is actually easy for us to unambiguously parse.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Wesley Wigham (weswigham)
requested review from
Ryan Cavanaugh (RyanCavanaugh),
Mohamed Hegazy (mhegazy) and
Ron Buckton (rbuckton)
Sheetal Nandi (sheetalkamat)
added a commit
to microsoft/TypeScript-TmLanguage
that referenced
this pull request
This handles support for microsoft/TypeScript#22415
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would find
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure why the original author didn't just use
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Ryan Cavanaugh (RyanCavanaugh)
approved these changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have nitty comments in moved code that can be ignored 👍
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Closed
1 task done
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
This was referenced
This was referenced
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
Andrew Branch (@andrewbranch) yes, it is the same issue. In #22636 Mohamed Hegazy (@mhegazy) seems saying it would be addressed in 2.9. However, at least it is not yet in 2.9.0-dev.20180503. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
#23492 has yet to be merged |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Wesley Wigham (@weswigham) sweet! thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Question, What would be best way to pass a generic type to a child component? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
What you have there aught to be correct. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Wesley Wigham (@weswigham) i was getting a |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Oh i guess i should of mentioned that List accepts a generic type |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
You need to constrained your |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
is there a non-jsx equivalent for this? e.g. given this usage w/ jsx <MyGenericComponent<SomeType> {...props} /> what is the equivalent using createElement(StringInput, props) // [ts] Type '{}' is not assignable to type 'SomeType'. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I believe the first generic parameter of createElement<SomeType>(MyGenericComponent, props) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The type signature of function createElement<P>( type: SFC<P> | ComponentClass<P> | string, props?: Attributes & P | null, ...children: ReactNode[]): ReactElement<P>; so looks like the first parameter is Props |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
nice
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.