Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

How to use Jquery clockpicker with React? #131

Open
IchrakMansour opened this issue Apr 23, 2019 · 1 comment
Open

How to use Jquery clockpicker with React? #131

IchrakMansour opened this issue Apr 23, 2019 · 1 comment

Comments

@IchrakMansour
Copy link

I want to develop a react clockpicker input with jquery, I used this : https://github.com/weareoutman/clockpicker,

I install jquery with : npm install --save jquery

My code is :

import { findDOMNode } from 'react-dom';
import $ from 'jquery';
handleInput = () => {
  const el = findDOMNode(this.refs.input);
  $(el).clockpicker();
}
render () {
  return (
    <div class="input-group clockpicker" data-placement="right" data-align="top" data-autoclose="true">
      <input  ref="input"  data-default="20:48" onClick={this.handleInput}/>
      <span class="input-group-addon">
        <span class="glyphicon glyphicon-time"></span>
      </span>
    </div>
  );
}

When I run it, I get an input having 20:48 as a default data, but the clockpicker doesn't display with his icon, and I get :

AjouterDisponibilite.js:367 Uncaught TypeError: jquery__WEBPACK_IMPORTED_MODULE_19___default(...)(...).clockpicker is not a function on this line : $(el).clockpicker();

How can I fix it ?

@JaiKumaresh
Copy link

If anything possible to we're use this package in React.js.?

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

No branches or pull requests

2 participants