arthurdenner / react-semantic-ui-datepickers

Datepickers built with Semantic UI for React and Dayzed.
https://react-semantic-ui-datepickers.vercel.app
MIT License
95 stars 56 forks source link

Error:o is not a function (App Crashes upon date selections) #18

Closed Boasbabs closed 5 years ago

Boasbabs commented 5 years ago

🐛 bug report

I get this error when I select a date. What am I doing wrong?

TypeError: o is not a function[Learn More] react-semantic-ui-datepickers.js:1
The above error occurred in the <t> component:
    in t (created by FormField)
    in div (created by FormField)
    in FormField (at AddressForm.jsx:76)
    in form (created by Form)
    in Form (at AddressForm.jsx:45)
    in div (created by Segment)
    in Segment (at AddressForm.jsx:44)
    in div (created by GridColumn)
    in GridColumn (at AddressForm.jsx:43)
    in div (created by GridRow)
    in GridRow (at AddressForm.jsx:42)
    in AddressForm (at Checkout.jsx:119)
    in Checkout (created by LoadableComponent)
    in LoadableComponent (created by Route)
    in Route (at App.jsx:27)
    in div (created by Grid)
    in Grid (at PageContainerChildren.jsx:17)
    in div (created by Responsive)
    in Responsive (at PageContainerChildren.jsx:16)
    in PageContainerChildren (at PageContainer.jsx:54)
    in div (created by Responsive)
    in Responsive (at PageContainer.jsx:48)
    in PageContainer (at App.jsx:25)
    in Switch (at App.jsx:24)
    in Router (created by BrowserRouter)
    in BrowserRouter (at App.jsx:23)
    in div (at App.jsx:22)
    in App (at index.js:8)

Consider adding an error boundary to your tree to customize error handling behavior. Visit https://fb.me/react-error-boundaries to learn more about error boundaries.

Description of the problem

screenshot from 2018-11-30 00-00-28 screenshot from 2018-11-30 00-00-16

How has this issue affected you? What are you trying to accomplish?

I am trying to select a date thru the datepicker and pass value to my state. My package.json (note: some packages have been removed)

"dependencies": {
    "npm-run-all": "4.1.3",
    "perfect-scrollbar": "1.4.0",
    "prop-types": "^15.6.2",
    "react": "16.4.0",
    "react-chartist": "0.13.1",
    "react-dom": "16.4.0",
    "react-google-maps": "9.4.5",
    "react-image-gallery": "^0.8.11",
    "react-loadable": "^5.5.0",
    "react-materialize": "^2.4.5",
    "react-moment": "^0.8.2",
    "react-notification-system": "^0.2.17",
    "react-parallax": "^2.0.0",
    "react-router-dom": "4.3.1",
    "react-scripts": "1.1.4",
    "react-semantic-ui-datepickers": "^1.7.0",
    "react-slick": "^0.23.1",
    "react-spinners": "^0.4.5",
    "react-stripe-checkout": "^2.6.3",
    "react-stripe-elements": "^2.0.1",
    "react-swipeable-views": "^0.13.0",
    "react-tagsinput": "^3.19.0",
    "react-toastify": "^4.4.0",
    "redux": "^4.0.1",
    "redux-thunk": "^2.3.0",
    "semantic-ui": "^2.4.2",
    "semantic-ui-react": "^0.83.0",
  },

Link to a sandbox: [link]() (optional)

arthurdenner commented 5 years ago

Hi, @Boasbabs!

Could you provide a sandbox with the error or maybe some sample code of how you are using the library so I can see if there is something wrong?

jaybe78 commented 5 years ago

This one can be closed. That issue occurs when OnDateChange function is not defined! The error message is not clear though

arthurdenner commented 5 years ago

@jaybe78, the onDateChange function is declared as required with propTypes, so you must see a warning in the console if you don't provide it, but unfortunately this doesn't prevent a runtime error.

I'm going to close the issue, but feel free to open an issue or a PR if you have any suggestion on how to improve this behaviour or error message.