bokuweb / re-bulma

[Deprecated] 💎Bulma components for React
http://bokuweb.github.io/re-bulma/
MIT License
364 stars 66 forks source link

Got TypeError: Cannot read property 'any' of undefined ./node_modules/re-bulma/lib-es/grid/columns.js:25 #93

Open azulkipli opened 6 years ago

azulkipli commented 6 years ago

Hi, when trying install re-bulma based on this instruction (using create-react-app which is already use react version 16.0.0),

https://github.com/bokuweb/re-bulma#install

I put these on index.js

import insertCss from "insert-css";
import css from "re-bulma/build/css";
try {
  if (typeof document !== "undefined" || document !== null) insertCss(css, { prepend: true });
} catch (e) {}

but after that, I got this error

TypeError: Cannot read property 'any' of undefined ./node_modules/re-bulma/lib-es/grid/columns.js:25

any clue how to solve this issue?

Thank you

screen shot 2017-11-08 at 18 21 33

Vortelf commented 6 years ago

I'm getting error at the same place but the error is TypeError: __WEBPACK_IMPORTED_MODULE_0_react__.PropTypes is undefined

Using React@16.1.0 re-bulma@0.4.6 Code I'm using is

import { Container, Column, Columns } from 're-bulma';

class App extends Component {
  render() {
    return (
      <Container>
        <Columns>
          <Column>
            <NavLink className="button" activeClassName="active" exact to="/">
              Something List
            </NavLink>
          </Column>
          <Column>
            <NavLink className="button" activeClassName="active" exact to="/something/new">
              Add Something
            </NavLink>
          </Column>
        </Columns>
        <Route exact path="/" component={SomethingPage}/>
        <Route path="/something/new" component={SomethingFormPage}/>
        <Route path="/something/edit/:_id" component={SomethingFormPage}/>
      </Container>
    );
  }
}
panbhatt commented 6 years ago

I think this is expected, since the React PropTypes has been moved to a different package (not backward compatible and this still uses React < 16.0.0). Need a PR to solve this.

nick264 commented 6 years ago

My pull request solves this, I think: #97 . Lmk if you have feedback.

nick264 commented 6 years ago

Since this project isn't being maintained, I'm not sure this pull request will be merged - and even if it is, this is probably not a package to rely on unless someone else takes over.

If it's helpful for others, we've temporarily solved the problem by including a dependency directly from the patched version:

screen shot 2018-05-10 at 9 27 26 am

In the medium term we're moving to semantic-ui-react (though there are other bulma-based react packages you could migrate to, e.g. https://github.com/couds/react-bulma-components).