How to use the mobx-react.PropTypes.observableObject function in mobx-react

To help you get started, we’ve selected a few mobx-react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github danielliao11 / spring-microservice-boilerplate / web / dashboard / src / components / resource / Tool.jsx View on Github external
>
          <menuitem value="">
            <em>None</em>
          </menuitem>
          {array.map(item =&gt; (
            <menuitem value="{item.value}">{item.name}</menuitem>
          ))}
        
      
    
  );
};

Tool.propTypes = {
  array: ReactPropTypes.arrayOf(ReactPropTypes.shape()).isRequired,
  store: PropTypes.observableObject.isRequired,
};

export default Tool;
github kwzm / react-mobx-react-router-boilerplate / src / routes / demo / routes / products / components / List / List.js View on Github external
showSizeChanger: true,
            showQuickJumper: true,
            showTotal: (totalNum, range) =&gt; `第${range[0]}-${range[1]}条 总数${totalNum}条`,
            onChange: this.handlePageChange,
            onShowSizeChange: this.handlePageSizeChange,
          }}
        /&gt;
        
      
    )
  }
}

List.wrappedComponent.propTypes = {
  data: ObservablePropTypes.observableArray.isRequired,
  filter: ObservablePropTypes.observableObject,
  pagination: ObservablePropTypes.observableObject.isRequired,
  categories: ObservablePropTypes.observableArray.isRequired,
  listLoading: PropTypes.bool.isRequired,
  removeProduct: PropTypes.func.isRequired,
}

List.propTypes = {
  history: PropTypes.object.isRequired,
  location: PropTypes.object.isRequired,
}

export default withRouter(List)
github danielliao11 / spring-microservice-boilerplate / web / dashboard / src / containers / ResourcePage.jsx View on Github external
const { resource } = this.props;
    return (
      }
        searchBar={}
        edit={}
        store={resource}
      /&gt;
    );
  }
}

ResourcePage.wrappedComponent.propTypes = {
  resource: PropTypes.observableObject.isRequired,
};

export default withStyles(resourcePageStyle)(ResourcePage);
github danielliao11 / spring-microservice-boilerplate / web / dashboard / src / containers / LoginPage.jsx View on Github external
);
  }
}

LoginPage.propTypes = {
  classes: ReactPropTypes.shape().isRequired,
  history: ReactPropTypes.shape({
    push: ReactPropTypes.func,
  }).isRequired,
};

LoginPage.wrappedComponent.propTypes = {
  authorization: PropTypes.observableObject.isRequired,
  sign: PropTypes.observableObject.isRequired,
};

export default withStyles(loginPageStyle)(LoginPage);
github qilin-editor / qilin-app / src / scripts / components / Editor / ContentEditable.jsx View on Github external
import React, { Component } from "react";
import { inject, observer, PropTypes as MobxPropTypes } from "mobx-react";
import Editor from "qilin-components/editor";

@inject(["editor"])
@observer
class ContentEditable extends Component {
  static propTypes = {
    editor: MobxPropTypes.observableObject
  };

  editorDidChange = (editor, data, value) =&gt; {
    this.props.editor.changeContent(value);
  };

  render() {
    return (
      
    );
  }
}
github danielliao11 / spring-microservice-boilerplate / web / dashboard / src / layouts / Layout.jsx View on Github external
);
  }
}

Layout.propTypes = {
  children: ReactPropTypes.element.isRequired,
  location: ReactPropTypes.shape({
    pathname: ReactPropTypes.string,
  }).isRequired,
  classes: ReactPropTypes.shape().isRequired,
};

Layout.wrappedComponent.propTypes = {
  authorization: PropTypes.observableObject.isRequired,
  configuration: PropTypes.observableObject.isRequired,
  notification: PropTypes.observableObject.isRequired,
};

export default withStyles(layoutStyle)(Layout);
github qilin-editor / qilin-app / src / scripts / components / Helpers / FileName.jsx View on Github external
import React, { Component } from "react";
import { inject, observer, PropTypes as MobxPropTypes } from "mobx-react";

@inject(["editor"])
@observer
class FileName extends Component {
  static propTypes = {
    editor: MobxPropTypes.observableObject
  };

  reveal = () =&gt; {
    if (this.props.editor.path) {
      require("opn")(this.props.editor.directory);
    }
  };

  render() {
    const { filename, saved } = this.props.editor;
    const saveIndicator = filename ? (saved ? "" : "•") : "";

    return (
      <p>
        <span>{`${filename || "Untitled"}`}</span>
        <span>{saveIndicator}</span></p>
github kwzm / react-mobx-react-router-boilerplate / src / routes / demo / routes / todo / components / TodoItem / TodoItem.js View on Github external
<div>
          
        </div>
      
    )
  }
}

TodoItem.wrappedComponent.propTypes = {
  removeTodo: PropTypes.func.isRequired,
}

TodoItem.propTypes = {
  todo: ObservablePropTypes.observableObject.isRequired,
}

export default TodoItem
github danielliao11 / spring-microservice-boilerplate / web / dashboard / src / components / commons / TableCard.jsx View on Github external
};

TableCard.defaultProps = {
  cardTitle: 'Title',
  cardDescription: 'This is comment',
  tableBody: (<div>),
  searchBar: (<div>),
};

TableCard.propTypes = {
  cardTitle: ReactPropTypes.string,
  cardDescription: ReactPropTypes.string,
  classes: ReactPropTypes.shape().isRequired,
  tableBody: ReactPropTypes.element,
  searchBar: ReactPropTypes.element,
  store: PropTypes.observableObject.isRequired,
};

export default withStyles(tableCardStyle)(TableCard);
</div></div>
github kwzm / react-mobx-react-router-boilerplate / src / routes / demo / routes / products / components / List / List.js View on Github external
showQuickJumper: true,
            showTotal: (totalNum, range) =&gt; `第${range[0]}-${range[1]}条 总数${totalNum}条`,
            onChange: this.handlePageChange,
            onShowSizeChange: this.handlePageSizeChange,
          }}
        /&gt;
        
      
    )
  }
}

List.wrappedComponent.propTypes = {
  data: ObservablePropTypes.observableArray.isRequired,
  filter: ObservablePropTypes.observableObject,
  pagination: ObservablePropTypes.observableObject.isRequired,
  categories: ObservablePropTypes.observableArray.isRequired,
  listLoading: PropTypes.bool.isRequired,
  removeProduct: PropTypes.func.isRequired,
}

List.propTypes = {
  history: PropTypes.object.isRequired,
  location: PropTypes.object.isRequired,
}

export default withRouter(List)