Comments (8)
I am getting the following error when implementing 'use12Hours' prop on this component in a JSX file but in a project that has TypeScript. Works fine without the 'use12Hours' prop. Any ideas how to get this to work?
Component Code
<TimePicker use12Hours onChange={(handleTimeChange)} value={value} />
Also doesn't work
<TimePicker use12Hours={true} onChange={(handleTimeChange)} value={value} />
Error
TimePicker.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'translatedValue')
Here is my declaration.d.ts file
declare module 'react-ios-time-picker';
from react-ios-time-picker.
Hi @Entropiks, you may need to check the value and set it like this "12:00 AM" it needs to have the hour format AM or PM to work, and the typescript version is already in the way with also a lot of changes to come
from react-ios-time-picker.
Here is typescript version, I create- https://www.npmjs.com/package/react-time-picker-typescript
This is also safe for nextjs ssr!
from react-ios-time-picker.
Still working on it, will support typescript and many more functionalities like infinite scroll and seconds too
from react-ios-time-picker.
Yes it needs the Types file (t.ds). Won't work without it.
from react-ios-time-picker.
Hi @Entropiks, you may need to check the value and set it like this "12:00 AM" it needs to have the hour format AM or PM to work, and the typescript version is already in the way with also a lot of changes to come
This fixed the issue, thank you! Great component.
from react-ios-time-picker.
Any update on the Typescript? I have been using a different plugin but would prefer yours.
from react-ios-time-picker.
This!
from react-ios-time-picker.
Related Issues (11)
- Getting error while trying to click and open a field which has null value HOT 2
- Doesn't work, the portal doesn't respond to state. HOT 4
- Doesn't work in NextJS 14. No response when Picker is clicked.
- pickerDefaultValue HOT 4
- Keyboard Events
- Hours, Minutes and Seconds Picker
- Style Issue
- An option for min and max time value.
- Request Option for custom increment i.e. 15min options
- Getting ReferenceError: document is not defined while using in Next.js
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-ios-time-picker.