react-static-site icon indicating copy to clipboard operation
react-static-site copied to clipboard

Does the static page lose all the javascript?

Open tata9001 opened this issue 9 years ago • 0 comments

For example, I add a MyButton on the example page:

var MyButton = React.createClass({
  clickHandler: function(){
    alert("test");
  },

  render: function() {
    return <button onClick={this.clickHandler}>Test</button>;
  }
});

var LayoutNav = React.createClass({
  render: function() {
    return (
      <nav id="layout-nav">
        <div className="pure-menu pure-menu-open">
          <a className="pure-menu-heading">Site Nav</a>

          <ul>
            <li><Link to="home">Home</Link></li>
            <li><Link to="about">About</Link></li>
            <li><Link to="blog">Blog</Link></li>
            <li><MyButton/></li>
          </ul>
        </div>
      </nav>
    );
  }
});

After, I build static , the Button's click event lost. Is it an issue? Thanks.

tata9001 avatar Aug 22 '16 09:08 tata9001