Closed TierC24 closed 2 years ago
Hello,
Thanks for using this package ! 😄
Explanation here: https://github.com/xrutayisire/react-js-cron/discussions/24#discussioncomment-2588539
Xavier
Thanks , already solve the problem!
@.***
From: Xavier Rutayisire Date: 2022-05-13 17:09 To: xrutayisire/react-js-cron CC: TierC24; Author Subject: Re: [xrutayisire/react-js-cron] What is useCronReducer? How use it? (Issue #26) Hello, Thanks for using this package ! ???? Explanation here: #24 (reply in thread) Xavier — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
import { useState } from "react"; import { Divider, Input as AntdInput } from "antd"; import Cron, { CronError, CronProps } from "react-js-cron"; import "antd/dist/antd.css"; import { InfoCircleOutlined } from '@ant-design/icons'; import useCronReducer from 'react-js-cron';
export default function Demo() {
const defaultValue = '30 5 1,6'
/**
const [error, onError] = useState()
*/
let props : CronProps = { value:defaultValue, setValue:(defaultValue:string)=>{} }
const [values, dispatchValues] = useCronReducer(props) //=>error const [error, onError] = useState()
return (
Error: {error ? error.description : 'undefined'}