Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not support hooks #731

Open
ghost opened this issue Jul 23, 2020 · 0 comments
Open

Does not support hooks #731

ghost opened this issue Jul 23, 2020 · 0 comments

Comments

@ghost
Copy link

ghost commented Jul 23, 2020

I'm trying to use react's hooks, but it doesn't seem to be supported.
value[1].clone is not a function

example:
import React, { useEffect, useState, useRef } from 'react';
import styles from './WorksCenter.css';
/**

  • 日历
  • @requires RangeCalendar 日历弹出
  • @requires RangeCalendar 日历文本框
  • @requires zhCN 语言
    /
    import RangeCalendar from 'rc-calendar/lib/RangeCalendar';
    import Picker from 'rc-calendar/lib/Picker';
    import zhCN from 'rc-calendar/lib/locale/zh_CN';
    import moment from 'moment';
    import 'moment/locale/zh-cn';
    export default function WorksCenter() {
    /
    *
    • 日历
    • @param time 开始和结束时间数组
    • @param hoverValue 不知道做啥用
    • @param open 是否显示日历弹出框(没啥用)
    • @param calendar 日历弹出框配置
      */
      const now = moment();
      now.utcOffset(8);
      const [time, setTime] = useState(['', '']);
      const [hoverTime, setHoverTime] = useState(['', ''])
      const calendar = (
      <RangeCalendar
      className={${styles['rc-calendar']}}
      style={{zIndex: '100', left: '440px', top: '30px'}}
      hoverValue={hoverTime}
      onHoverChange={(data) => {setHoverTimeFn(data)}}
      showWeekNumber={false}
      dateInputPlaceholder={['start', 'end']}
      defaultValue={[now, now.clone().add(1, 'months')]}
      locale={zhCN}
      />
      );
      const setHoverTimeFn = (data) => {
      setHoverTime(data)
      }
      return (
    {/* 筛选 */}
    {console.log('ok', data)}} animation="slide-up" calendar={calendar} > { () => { return ( ); } }

);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants