简体   繁体   中英

DatePicker component native handling for react-native-web

currently we are using react-date-picker (version: "react-native-web": "^0.11.1") Do you know how to customize this library to using native design for each platform? Or do you know about some another library for this purpose?

I am aware of the similar thread react-native-web, DatePicker component? but wondering if someone has some different solution or opinion...

I created one for web:

const MyWebDatePicker = () => {
const [date, setDate] = useState(new Date(Date.now()));


   return createElement('input', {
       type: 'date',
       value: date.toISOString().split("T")[0],
       onChange: (event) => {
         setDate(new Date(event.target.value))
         },
       style: {height: 30, padding: 5, border: "2px solid #677788", borderRadius: 5,  width: 250}
     })
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM