Search code examples
reactjsdialogmaterial-uischeduler

How to use material-ui dialog in scheduler?


I am currenlty react-big-scheduler to create my application. However, I am facing a problem replacing with my material-ui dialog.

newEvent = (...) => {
    if(window.confirm('...'){
    ...
    }

When I export material-ui dialog as a component and replaced the code to:

newEvent = (...) => {
    <NewEventDialog />
}

I have the following error:

Expected an assignment or function call and instead saw an expression. 

As I am new to react, my questions would be:

  • I am intending to replace the window.confirm to a more visually appealing one such as material-ui
  • How would you suggest I import it into my current scheduler?
  • How do I pass on the "submit" boolean to my scheduler?

Thank you in advance.


Solution

  • you have to return the from the newEvent Component

    newEvent = (...) => {
      return (<NewEventDialog />)
    }