How to use react - 4 common examples

To help you get started, we’ve selected a few 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 choerodon / agile-service-old / react / routes / settings / FastSearch / FastSearchHome / FastSearchHome-copy.js View on Github external
function Search(props) {
  const [filters, setFilters] = useState([]);
  const [createFileterShow, setCreateFileterShow] = useState(false);
  const [currentFilterId, setCurrentFilterId] = useState(undefined);
  const [filter, setFilter] = useState({});
  const [loading, setLoading] = useState(false);
  const [barFilters, setBarFilters] = useState([]);
  const [filterName, setFilterName] = useState('');
  const [deleteFilterShow, setDeleteFilterShow] = useState(false);
  const [editFilterShow, setEditFilterShow] = useState(false);

  const column = [
    {
      title: '名称',
      dataIndex: 'name',
      // width: '20%',
      render: name => (
        <div style="{{">
          
            </div>
github grommet / grommet / es6 / components / Select / stories / ManyOptions.js View on Github external
var ManyOptions = function ManyOptions() {
  var _React$useState = React.useState([]),
      selected = _React$useState[0],
      setSelected = _React$useState[1];

  var _React$useState2 = React.useState(dummyOptions),
      options = _React$useState2[0],
      setOptions = _React$useState2[1];

  return React.createElement(Grommet, {
    full: true,
    theme: grommet
  }, React.createElement(Box, {
    fill: true,
    align: "center",
    justify: "start",
    pad: "large"
  }, React.createElement(Select, {
    multiple: true,
    closeOnChange: false,
    placeholder: "select an option...",
    selected: selected,
    options: options,
    dropHeight: "medium",
    onClose: function onClose() {
      return setOptions(options.sort(function (p1, p2) {
github chenxiaolei / ZLMediaKit_NVR_UI / src / component / ReactPlayer / index.es.js View on Github external
type: "fullscreen-exit"
  })), !fullscreen && React.createElement("button", {
    type: "button",
    onClick: requestFullscreen
  }, React.createElement(Icon, {
    type: "fullscreen"
  })))), x5playsinline && !x5videofullscreen && src && !loading && !waiting && !seeking && !ended && !kernelMsg && React.createElement("button", {
    className: styles$1.blocked,
    onClick: onPlayClick
  }, React.createElement(Icon, {
    type: "play-circle"
  })), loading && !kernelMsg && React.createElement("div", {
    className: styles$1.loading
  }, React.createElement(Icon, {
    type: "loading"
  })), kernelMsg && React.createElement("div", {
    className: styles$1.kernelMsg
  }, kernelMsg.type, ": ", kernelMsg.detail));
});
ReactPlayerSkin.propTypes = {
github guardian / editions / projects / Mallard / src / hooks / use-screen.ts View on Github external
const useDimensions = (): ScaledSize =&gt; {
    const [dimensions, setDimensions] = useState(Dimensions.get('window'))
    useEffect(() =&gt; {
        const listener = (
            ev: Parameters&lt;
                Parameters[1]
            &gt;[0],
        ) =&gt; {
            /*
            this fixes this issue:
            https://trello.com/c/iEtMz9TH/867-video-stretched-on-ios-and-android-crash-on-orientation-change

            this means we will never relayout on smaller screens. For now this is ok
            because our screen size assumptions are a 1:1 match with iphone/ipad and
            a good enough™ match on android

            a more elegant fix would be to detect when a full screen video/photo
            is playing, basically anything that enables rotation when

react

React is a JavaScript library for building user interfaces.

MIT
Latest version published 19 days ago

Package Health Score

89 / 100
Full package analysis

Popular react functions