Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

73
Views
How can I use react-datepicker in the ReScript app

I`m trying to use an external library such as react-datepicker.

My code and usage:

module DatePicker = {
  @react.component @module("react-datepicker")
  external make: () => React.element = "default";
}

@react.component
let make = () => {
  <DatePicker />
}

However, I`ve got an error:

Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. Check the render method of ...

P.S.: I tried a solution from this answer Can't create ReasonML bindings for react-contenteditable but it doesn't help me with an error

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

@scope decorator is a solution

module Dp = {
  @react.component @module("react-datepicker") @scope("default")
  external make: () => React.element = "default";
}

@react.component
let make = () => {
  <Dp />
}

https://forum.rescript-lang.org/t/help-with-binding-currying/1540/11?u=grigoryev

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!