osrf / rmf_demos

Demos to showcase the capabilities of RMF
Apache License 2.0
69 stars 38 forks source link

Fix/nodev10 compatiblity #206

Closed arjo129 closed 3 years ago

arjo129 commented 3 years ago

Seems like in older versions of node/typescript/react we get the following error:

ERROR in /home/ubuntu/rmf_demos_ws/src/rmf/rmf_demos/rmf_demo_panel/rmf_demo_panel/static/src/components/fixed-components/rostime-clock.tsx
./src/components/fixed-components/rostime-clock.tsx 9:20-27
[tsl] ERROR in /home/ubuntu/rmf_demos_ws/src/rmf/rmf_demos/rmf_demo_panel/rmf_demo_panel/static/src/components/fixed-components/rostime-clock.tsx(9,21)
      TS2345: Argument of type '() => () => boolean' is not assignable to parameter of type 'EffectCallback'.
  Type '() => boolean' is not assignable to type 'void | Destructor'.
    Type '() => boolean' is not assignable to type 'Destructor'.
      Type 'boolean' is not assignable to type 'void | { [UNDEFINED_VOID_ONLY]: never; }'.
ERROR in /home/ubuntu/rmf_demos_ws/src/rmf/rmf_demos/rmf_demo_panel/rmf_demo_panel/static/src/components/robots/robot-cards-container.tsx
./src/components/robots/robot-cards-container.tsx 22:20-27
[tsl] ERROR in /home/ubuntu/rmf_demos_ws/src/rmf/rmf_demos/rmf_demo_panel/rmf_demo_panel/static/src/components/robots/robot-cards-container.tsx(22,21)
      TS2345: Argument of type '() => () => boolean' is not assignable to parameter of type 'EffectCallback'.
  Type '() => boolean' is not assignable to type 'void | Destructor'.
    Type '() => boolean' is not assignable to type 'Destructor'.
      Type 'boolean' is not assignable to type 'void | { [UNDEFINED_VOID_ONLY]: never; }'.
ERROR in /home/ubuntu/rmf_demos_ws/src/rmf/rmf_demos/rmf_demo_panel/rmf_demo_panel/static/src/components/tasks/tasks-container.tsx
./src/components/tasks/tasks-container.tsx 22:20-27
[tsl] ERROR in /home/ubuntu/rmf_demos_ws/src/rmf/rmf_demos/rmf_demo_panel/rmf_demo_panel/static/src/components/tasks/tasks-container.tsx(22,21)
      TS2345: Argument of type '() => () => boolean' is not assignable to parameter of type 'EffectCallback'.
  Type '() => boolean' is not assignable to type 'void | Destructor'.
    Type '() => boolean' is not assignable to type 'Destructor'.
      Type 'boolean' is not assignable to type 'void | { [UNDEFINED_VOID_ONLY]: never; }'.

This minor patchset addresses the error. Honestly, I have no idea whats going on lol. Highly recommend someone tests that my changes don't break anything.