Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

branch fails in 0.21.0 for react@0.14.x #288

Closed
istarkov opened this issue Dec 12, 2016 · 1 comment
Closed

branch fails in 0.21.0 for react@0.14.x #288

istarkov opened this issue Dec 12, 2016 · 1 comment

Comments

@istarkov
Copy link
Contributor

Example (react 0.14.x):

const modalWindow = ({
  theme,
}) => (
  <div className={theme.component}>
  </div>
);

export const modalWindowHOC = compose(
  themr('modalWindow', modalWindowStyles),
  branch(
    ({ visible }) => !!visible,
    v => v,
    renderNothing,
  ),
);

Errror:

warning.js?0260:45Warning: branch(modalWindow)(...): No `render` method found on the returned component instance: you may have forgotten to define `render`, returned null/false from a stateless component, or tried to render an element whose type is a function that isn't a React component
@istarkov
Copy link
Contributor Author

istarkov commented Dec 12, 2016

The problem that in react x 0.14 which I still use in production ;-) you can't return null from functional components facebook/react#4599 so any branch like

  branch(
    () => false,
    v => v,
    () => () => undefined | null | false,
  ),

will fail

istarkov added a commit that referenced this issue Dec 12, 2016
@istarkov istarkov changed the title branch fails in 0.21.0 branch fails in 0.21.0 for react@0.14.x Dec 12, 2016
istarkov added a commit that referenced this issue Dec 20, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant