StephenChou1017 / react-big-scheduler

A scheduler and resource planning component built for React and made for modern browsers (IE10+)
https://stephenchou1017.github.io/scheduler/#/
MIT License
754 stars 414 forks source link

Typescript - React.createElement: type is invalid #192

Closed rwilson504 closed 4 years ago

rwilson504 commented 4 years ago

Am am attempting to utilize this control in a Typescript project.

I have done an npm install on react-big-scheduler and @types\react-big-scheduler

Here is my import statement image

Here is my return statement, i'm just using empty function because i want to get it up and running. return <Scheduler schedulerData={schedulerData.schedulerData} prevClick={() => {}} nextClick={() => {}} onSelectDate={() => {}} onViewChange={() => {}} />; }

When i run it all the other properties show up such as the SchedulerData but react-big-scheduler.Scheduler is undefined image

Here is the error i get in the console. image

What am I missing?

Thanks,

Rick

rwilson504 commented 4 years ago

Also my React app is a Functional Component.

rwilson504 commented 4 years ago

OK got it working had to change my import to this.

import Scheduler ,{SchedulerData, ViewTypes, Event} from 'react-big-scheduler';

Also had to add this line to the end of the index.d.ts file in the @types project

export default Scheduler;