pushtell/react-bootstrap-date-picker

React 16.0 + PropTypes Issue

Opened this issue ยท 30 comments

Having react and react-dom upgraded to 16, I am getting the following error which I suspect relates to the new way one need to declare pros types using PropTypes. I think this repo has already upgraded to use new format of PropTypes but I'm not clear why still seeing this error!

react-bootstrap-date-picker/lib/index.js:117
    selectedDate: _react2.default.PropTypes.object,
                                           ^
TypeError: Cannot read property 'object' of undefined
    at Object.<anonymous> (../node_modules/react-bootstrap-date-picker/lib/index.js:117:44)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)

Issue is temporarily fixed by doing:

"react-bootstrap-date-picker": "github:pushtell/react-bootstrap-date-picker#f622dc8872dd180324ba5d3c295d009848f5814b",

but I wonder if this is sustainable. Can we get a version bump wherein we have the latest commits?

+1 for version bump with latest in master f622dc8

Please. Do. Version bump.

Hello, curious if there is anything I can do to help get this update released to NPM? Is the release blocked bc there is a manual testing step that needs to occur? I would be happy to test and document the results if that helps the maintainers get the release out. Thanks! ๐Ÿ‘‹

bumpy bump bump bump!

bump in NPN please.

Even when I resolve the package directly from github I get an error and I have to install the create-react-class module in my project in order for react-bootstrap-date-picker to work... Anyone experiencing this issue as well ?

For those who still need a published NPM package in the meantime: https://www.npmjs.com/package/react-16-bootstrap-date-picker

@pushtell We really need a version bump in NPM ๐Ÿ™

@Siyfion just use the one published by @DaemonAlchemist in the comment before - simple ๐Ÿ˜

@joshuanutmeg I get the following error with that version:

./node_modules/react-16-bootstrap-date-picker/lib/index.js
Module not found: Can't resolve 'create-react-class' in '/Users/siyfion/Git/labellogiclive_app/node_modules/react-16-bootstrap-date-picker/lib'

EDIT: Ok, yarn add create-react-class seems to fix it, but I'm less than thrilled about adding extra yarn/npm dependencies when it simply needs updating.

So do I. My current workaround was to fork the repo, make create-react-class a non-dev dependency and install it from github. If you want to use it as well, you can just put this in your package.json:

"react-bootstrap-date-picker": "github:maxaggedon/react-bootstrap-date-picker",

The create-react-class dependency has been updated, and republished to the react-16-bootstrap-date-picker package. @pushtell, it would still be helpful to get the main package updated so we don't need to maintain this fork.

1st8 commented

In case you want to get rid of the create-react-class dependency entirely, feel free to use the fork where I prepared #151.

package.json: "react-bootstrap-date-picker": "github:mixxt/react-bootstrap-date-picker",.

Cheers ๐Ÿป

@1st8 warning: The datepicker is not showing in this branch when you click the element. It seems to have bad styling and also opacity is permanently zero.

1st8 commented

@krazyjakee That's odd, are you sure it is related to my changes?
I agree the styling is not great (probably because we're on a older bootstrap version), but I think it has always been like this:

bildschirmfoto 2018-02-19 um 13 02 09

Would you mind to continue in my PR? #151

@1st8 @krazyjakee I used another guy's git that, I think, is the same solution that @1st8 provided. ("react-bootstrap-date-picker": "github:maxaggedon/react-bootstrap-date-picker") I had the same issue that the data is not showing after selection.

My solution : provide the selected value got from event onChange to the value props of the DatePicker

onChange(value: string, formattedValue: string): void { this.setState({currentValue: value}); }

<DatePicker onChange={ this.onChange } value={ this.state.currentValue } />

All works for me fine !

Is there any update on this one?

@bagermen if you're desperate, fork your own and reference it in your package.json. You could even create a pull request to this repository and help everyone.

EDIT: He deleted his comment.

IzaGz commented

Hello i tried to use react-16-bootstrap-date-picker but got this
`

react-16-bootstrap-date-picker@5.1.2 requires a peer of create-react-class@^15.5.2 but none was installed.
npm WARN react-16-bootstrap-date-picker@5.1.2 requires a peer of react-bootstrap@^0.31.0 but none was installed.
npm WARN react-16-bootstrap-date-picker@5.1.2 requires a peer of react-dom@^15.5.4 but none was installed.
npm WARN react-bootstrap-date-picker@5.1.0 requires a peer of react-bootstrap@^0.31.0 but none was installed.

`

1st8 commented

Can you try using

"react-bootstrap-date-picker": "https://github.com/mixxt/react-bootstrap-date-picker.git#e535f478106c74bc03369d7a0cdfa943a97976ef",

in your package.json instead?

Hi @pushtell, is this project being maintained?

@DaemonAlchemist - do you mind enabling Issues on your fork?
I'd be willing to make some PRs to clean up.

Can someone advice as to why Error: Cannot find module 'react-bootstrap/lib/Button comes up? With react-bootstrap installed?

@orwell1984, I don't mind at all. Issues should be enabled now.

Can someone advice as to why Error: Cannot find module 'react-bootstrap/lib/Button comes up? With react-bootstrap installed?

In my installation there's no '/lib' in the path... it's just 'react-bootstrap/Button'. Same for all the other bootstrap components.

@blakecooper Did you solve this? I've got exactly the same error.

@LordA98 I think I ended up using this implementation instead: https://www.npmjs.com/package/react-datepicker

@blakecooper Yep, me too! Thanks for replying.