-
Notifications
You must be signed in to change notification settings - Fork 168
Add support for React-like custom element functions #281
base: master
Are you sure you want to change the base?
Conversation
This allows JSX to render custom elements defined as `const CustomElement = props = > <button onclick={props.onclick}>{props.label}</button>`
Thanks for this! Because of the camel-case changes, this is a breaking API change. If I release a 2.0 of this, it will force widgets to go to 2.0 as well. I'd rather not do that right now, so I'd like to thing of a way we can support both. I have an idea of how to this, just buried under grid work right now. |
Ok, let's move those commits into a separate PR. I think the element event/attribute names will require some more work to get 100% parity with React. |
I wonder if we should put the |
I am new to Typescript so that sounds like a good plan 👍 |
Possibly related: microsoft/TypeScript#8757 I wonder if we can figure out how to define the namespace in Phosphor, then import and use it in another module without needing to make it global for the whole app. |
As far as the |
@ellisonbg The typescript issue I linked seemed to be asking for that, and sounds like from the responses it's possible. I may be misunderstanding the conversation though. |
How is this looking wrt possibly merging it? |
I don't think we should merge this PR as we are wanting to maintain less VDOM stuff in phosphor, not more. Also, the JSX typings do conflict with |
This allows phosphor to render custom elements in JSX defined as: