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() {
        return React.createElement("div", null, "Classic Comp works");
    }

    // 1) Just returns undefined
    @JsProperty(namespace = JsPackage.GLOBAL)
    public static native Function getCustomComponent();

    // 2) Crashes compiler with internal error
    public static native Function constructor() /*-{
        return @com.ocs.react.client.CustomComponent::new(*);
    }-*/;

    // 3) Crashes compiler with internal error
    public static native Function constructor(String qualifiedJsTypeName) /*-{
        var cur = $wnd;
        var parts = namespace.split('.');
        for (var part; parts.length && (part = parts.shift());) {
            cur = cur[part];
        }
        return cur;
    }-*/;
}



>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/a52830d0-c2af-4660-b706-b9cc1d7123dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to