sidzan sidzan - 6 months ago 574
React JSX Question

how can i handle an event to open a window in react js?

I want to open a window after clicking the fshare

My render return is like this

<img src="/static/img/fshare.png" onClick={this.fbShare} />
<Button onClick={this.hide}>Close</Button>

I am creating a function

fbShare: function(event){


And i want to add the following code inside the function that basically opens a new window to share in facebook''sharer', 'toolbar=0,status=0,width=548,height=325');" target="_parent" href="javascript: void(0)">

But i am confused with how to handle this event.

Any suggestion will be highly appreciated.
Thanks in advance


You are on the right way!

Is it something you need? I prepared the example: click here

var Example = React.createClass({
    fbShare: function() {'[title]=Fb Share&p[summary]=Facebook share popup&p[url]=javascript:fbShare("")&p[images][0]=""', 'sharer', 'toolbar=0,status=0,width=548,height=325');

    render: function() {
        return (<div>
            <img src="" onClick={this.fbShare} />

    <Example />,