haoxins / react-flatpickr

flatpickr for React
MIT License
598 stars 102 forks source link

undefined is not an object (evaluating 'window.navigator.userAgent.indexOf') #95

Closed robinpaulson closed 5 years ago

robinpaulson commented 5 years ago

After I include react-flatpickr and run expo start, I get this error. My include lines are as follows: import React, { Component } from 'react'; import Flatpickr from 'react-flatpickr';

I have not invoked or used flatpickr in any part of the project yet

react-flatpickr v3.9 react-native v0.59

npm 6.9 node 11.15

jacobmischka commented 5 years ago

I believe this issue would be better raised upstream: https://github.com/flatpickr/flatpickr

However, I don't believe flatpickr has any intention of supporting React Native, so I believe you may need to look elsewhere.

Please feel free to write back if you're sure it's an issue with this library in particular.

robinpaulson commented 5 years ago

I believe this issue would be better raised upstream: https://github.com/flatpickr/flatpickr

I'd be interested to know why that is so. I get this is a fork of sorts, but why would the error be from there?

jacobmischka commented 5 years ago

This is not a fork, it's a wrapper component for the underlying library. It still uses flatpickr under the hood to do virtually all of the heavy lifting.

robinpaulson commented 5 years ago

OK, point taken. I'd still be interested to hear why you think this is an upstream problem though.

jacobmischka commented 5 years ago

Because this library doesn't attempt calling window.navigator.userAgent.indexOf(), flatpickr does.