pushtell / react-bootstrap-date-picker

React-Bootstrap based date picker.
MIT License
347 stars 195 forks source link

React 16.0 + PropTypes Issue #143

Open kevinguard opened 7 years ago

kevinguard commented 7 years ago

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)
kevinguard commented 7 years ago

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?

Quancom commented 7 years ago

+1 for version bump with latest in master https://github.com/pushtell/react-bootstrap-date-picker/commit/f622dc8872dd180324ba5d3c295d009848f5814b

Tomekmularczyk commented 7 years ago

Please. Do. Version bump.

thefivetoes commented 7 years ago

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! :wave:

python273 commented 7 years ago

@wehriam bump

joshuanutmeg commented 7 years ago

bumpy bump bump bump!

diegoNutmeg commented 7 years ago

bump in NPN please.

maxaggedon commented 6 years ago

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 ?

DaemonAlchemist commented 6 years ago

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

Siyfion commented 6 years ago

@pushtell We really need a version bump in NPM 🙏

joshuanutmeg commented 6 years ago

@Siyfion just use the one published by @DaemonAlchemist in the comment before - simple 😝

Siyfion commented 6 years ago

@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.

maxaggedon commented 6 years ago

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",
DaemonAlchemist commented 6 years ago

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.

seriousManual commented 6 years ago

+1

1st8 commented 6 years ago

In case you want to get rid of the create-react-class dependency entirely, feel free to use the fork where I prepared https://github.com/pushtell/react-bootstrap-date-picker/pull/151.

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

Cheers 🍻

krazyjakee commented 6 years ago

@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 6 years ago

@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? https://github.com/pushtell/react-bootstrap-date-picker/pull/151

TheThor59 commented 6 years ago

@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 !

thmsrth commented 6 years ago

Is there any update on this one?

krazyjakee commented 6 years ago

@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 6 years ago

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 6 years ago

Can you try using

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

in your package.json instead?

orwell1984 commented 5 years ago

Hi @pushtell, is this project being maintained?

orwell1984 commented 5 years ago

@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?

DaemonAlchemist commented 5 years ago

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

blakecooper commented 5 years ago

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.

LordA98 commented 4 years ago

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

blakecooper commented 4 years ago

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

LordA98 commented 4 years ago

@blakecooper Yep, me too! Thanks for replying.