How to use the recompose.renderComponent function in recompose

To help you get started, we’ve selected a few recompose 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 webex / react-widgets / packages / node_modules / @ciscospark / widget-meet / src / enhancers / withWebRtcSupport.js View on Github external
);
}

NoWebRTCSupport.propTypes = {
  // eslint-disable-next-line react/no-typos
  intl: intlShape.isRequired
};

const isNotSupported = ({media}) =>
  media.getIn(['webRTC', 'hasCheckedSupport']) &&
  !media.getIn(['webRTC', 'isSupported']);

export default branch(
  isNotSupported,
  renderComponent(NoWebRTCSupport)
);
github geosolutions-it / MapStore2 / web / client / plugins / import / Import.jsx View on Github external
props$.filter(({ layers }) => !layers || layers.length === 0)
                        .take(1)
                        .do(({ onClose = () => { } }) => onClose && onClose()).ignoreElements()
                )
        )),
    branch(
        ({ enabled }) => !enabled,
        renderNothing
    ),
    branch(
        ({ layers }) => !layers || layers.length === 0,
        compose(
            connect(() => ({}), {
                loadMap: configureMap
            }),
            renderComponent(DragZone)
        )
    )
)(StyleDialog);
github NCI-GDC / portal-ui / src / packages / @ncigdc / modern_components / GeneSymbol / GeneSymbol.relay.js View on Github external
export default (Component: ReactClass<*>) =>
  compose(
    branch(
      ({ geneId }) => !geneId,
      renderComponent(() => (
        <div>
          <pre>geneId</pre> must be provided
        </div>
      )),
    ),
    withPropsOnChange(['geneId'], ({ geneId }) =&gt; {
      return {
        variables: {
          filters: makeFilter([
            {
              field: 'genes.gene_id',
              value: [geneId],
            },
          ]),
        },
      };
github machawk1 / wail / wail-ui / loadingScreens / firstTime / components / javaCheck / javaCheckContents.js View on Github external
const displayWhich = shouldDisplay =>
  branch(
    props => shouldDisplay(props),
    renderComponent(NotJStepOrIs)
  )
github apiko-dev / Perfi / app / screens / transactions / transactionsList / TransactionsListView.js View on Github external
/&gt;
    ),
  };
});

const NoTransactions = () =&gt; (
  
);

const withoutTransactions = branch(
  ({ transactionsByCategories }) =&gt; R.isEmpty(transactionsByCategories),
  renderComponent(NoTransactions),
);

const TransactionsGroupedByCategories = compose(
  withTransactionsByCategories,
  withDataSource('categoriesById'),
  withGroupedTransactions,
  withoutTransactions,
)(ListView);

export default TransactionsGroupedByCategories;
github NCI-GDC / portal-ui / src / packages / @ncigdc / modern_components / CaseSummary / CaseSummary.js View on Github external
file_count: number,
  }&gt;,
}): number =&gt; {
  const slideTypes = ['Diagnostic Slide', 'Tissue Slide'];
  return (summary.experimental_strategies || []).reduce(
    (slideCount, { file_count, experimental_strategy }) =&gt;
      slideTypes.includes(experimental_strategy)
        ? slideCount + file_count
        : slideCount,
    0,
  );
};
export default compose(
  branch(
    ({ viewer }) =&gt; !viewer.repository.cases.hits.edges[0],
    renderComponent(() =&gt; <div>No case found.</div>),
  ),
  withTheme,
)(({ theme, viewer: { repository: { cases: { hits: { edges } } } } }) =&gt; {
  const p = edges[0].node;
  const totalFiles = p.files.hits.total;
  const imageFiles = p.files.hits.edges.filter(
    ({ node }) =&gt; node.data_type === 'Slide Image',
  );
  const slideCount = slideCountFromCaseSummary(p.summary);
  return (
    
      
            <i> Summary</i>
github htmlburger / carbon-fields / assets / js / fields / components / multiselect / index.js View on Github external
* Attach the setup hooks.
			 */
			withSetup(),

			/**
			 * Pass some handlers to the component.
			 */
			withHandlers({
				handleChange: ({ field, setFieldValue }) => value => setFieldValue(field.id, value.map(item => item.value))
			}),
		),

		/**
		 * Render the empty component.
		 */
		renderComponent(NoOptions)
	)
);

export default setStatic('type', [
	TYPE_MULTISELECT,
])(enhance(MultiselectField));
github appirio-tech / connect-app / src / routes / metadata / containers / ProjectTemplateDetails.jsx View on Github external
const showErrorMessageIfError = hasLoaded =>
  branch(hasLoaded, renderComponent(page500(CoderBot)), t => t)
const errorHandler = showErrorMessageIfError(props => props.errorTemp)