Open jhoabran opened 3 weeks ago
i have a Datepicker throwing the following error: Warning: MeasureElement: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
import React from "react" import { View, StyleSheet } from "react-native"; import { Datepicker, Icon, Text, IconElement } from "@ui-kitten/components"; export enum DateInputStatus{ Basic = "basic", Primary = "primary", Success = "success", Info = "info", Warning = "warning", Danger = "danger", Control = "control", } interface DateInputProps { date: Date; setDate: (Date) => void; label?: string; status?: DateInputStatus; caption?: string; placeholder?: string; } const CalendarIcon = (props): IconElement => ( <Icon {...props} name="calendar" /> ); const AlertIcon = (props: any): IconElement => ( <Icon {...props} name="alert-circle-outline" fill="red" /> ); export const DateInput = ({ label, caption, placeholder, date, setDate, status = DateInputStatus.Primary }: DateInputProps) => { const renderCaption = (): React.ReactElement => { return ( <View style={styles.captionContainer}> {AlertIcon(styles.captionIcon)} <Text style={styles.captionText}>{caption}</Text> </View> ); }; return ( <Datepicker label={label ? label : undefined} caption={caption ? renderCaption : undefined} placeholder={placeholder ? placeholder : undefined} status={status ? status : undefined} date={date} onSelect={(nextDate) => setDate(nextDate)} accessoryRight={CalendarIcon} /> ); }; const styles = StyleSheet.create({ captionContainer: { display: "flex", flexDirection: "row", alignItems: "center", }, captionText: { fontSize: 12, fontWeight: "400", color: "red", }, captionIcon: { width: 15, height: 15, marginRight: 5, }, });
i have a Datepicker throwing the following error: Warning: MeasureElement: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
UI Kitten and Eva version