Re: [gwt-contrib] Trying to use JsInterop to work with React

2016-03-18 Thread 'Goktug Gokdogan' via GWT Contributors
On Tue, Mar 15, 2016 at 8:12 PM, Paul Stockley wrote: > I didn't have any success with any of the methods you presented. See below > > import java.util.function.Function; > > @JsType(namespace = JsPackage.GLOBAL, name="CustomComponent") > > You don't need provide name when

Re: [gwt-contrib] Trying to use JsInterop to work with React

2016-03-15 Thread Paul Stockley
I didn't have any success with any of the methods you presented. See below import java.util.function.Function; @JsType(namespace = JsPackage.GLOBAL, name="CustomComponent") public class CustomComponent extends React.Component { public BaseProps props; public ReactElement render() {

Re: [gwt-contrib] Trying to use JsInterop to work with React

2016-03-14 Thread Paul Stockley
Thanks. I will give this a try. This information would be useful to add to any official JsInterop documentation. On Monday, March 14, 2016 at 2:26:46 AM UTC-4, Goktug Gokdogan wrote: > > I'm not knowledgeable about React but I assume that you cannot instantiate > a React component directly via

Re: [gwt-contrib] Trying to use JsInterop to work with React

2016-03-14 Thread Rene Hangstrup Møller
This is very interesting. We are also planning to make the move from GWT to Typescript and React. This might be useful for the transition period. The ambient Typescript definitions for React may also prove useful when defining the JsInterop types. Best regards Rene Den mandag den 14. marts

Re: [gwt-contrib] Trying to use JsInterop to work with React

2016-03-14 Thread 'Goktug Gokdogan' via GWT Contributors
I'm not knowledgeable about React but I assume that you cannot instantiate a React component directly via its constructor, instead you need to call another function and pass the class? The class in javascript is actually the "constructor" function. There are multiple ways to get the constructor

Re: [gwt-contrib] Trying to use JsInterop to work with React

2016-03-13 Thread Paul Stockley
If I can get a fully working proof of concept I may consider creating a project on github. However, there is still a lot to prove before I get to that stage. -- You received this message because you are subscribed to the Google Groups "GWT Contributors" group. To unsubscribe from this group

Re: [gwt-contrib] Trying to use JsInterop to work with React

2016-03-13 Thread James Horsley
Paul, any chance you're thinking of releasing your code on github or something? I think an open sourced ReactJs-GWT jsinterop wrapper would be something a number of people might be interested in using and contributing to. On Sun, Mar 13, 2016 at 9:45 PM Paul Stockley wrote:

Re: [gwt-contrib] Trying to use JsInterop to work with React

2016-03-13 Thread Paul Stockley
I did think about the ES6 class approach. However, The createElement method would need to take the class as a parameter (not an instance). How would I do that? On Sunday, March 13, 2016 at 5:32:19 PM UTC-4, Goktug Gokdogan wrote: > > See examples on how ES6 classes work with React. Those

Re: [gwt-contrib] Trying to use JsInterop to work with React

2016-03-13 Thread 'Goktug Gokdogan' via GWT Contributors
See examples on how ES6 classes work with React. Those examples should apply to @JsTypes as well. On Sun, Mar 13, 2016 at 2:12 PM, Colin Alworth wrote: > Yikes, that's rather opinionated. I don't personally work with React, but > I guess I'm surprised that it can't handle

Re: [gwt-contrib] Trying to use JsInterop to work with React

2016-03-13 Thread Colin Alworth
Yikes, that's rather opinionated. I don't personally work with React, but I guess I'm surprised that it can't handle actual inheritance (or even defining a prototype and attaching it to a constructor). Based on what you have there and the details described at

[gwt-contrib] Trying to use JsInterop to work with React

2016-03-13 Thread Paul Stockley
We have started using React (using ES6 and FlowTypes) which is quite nice. However, we have a large GWT application that we want to start embedding React within. This makes perfect sense for migrating away from Widgets to a more modern approach. So I decided I would try and define a Java Api