I am trying to pass an additional value in a mouse event because my handleMouseDown function is located in another file.
stage.on('mousedown', handleMouseDown(evt, stage))
Unfortunately, I encountered an error:
- Argument of type 'void' is not assignable to parameter of type 'KonvaEventListener<Stage, MouseEvent>'.ts(2345)
- Cannot find name 'evt'.ts(2304)
I attempted exporting my stage from the init file and importing it into another file, but I struggled with exporting values within export default.
import { handleMouseDown } from './stageEvents'
export default (): void => {
export const stage: Stage = new Konva.Stage({
container: 'container',
height: 500,
width: 500
})
// bind stage event
stage.on('mousedown', handleMouseDown)
This resulted in an error: Modifiers cannot appear here.
If anyone has any suggestions or ideas, please let me know. Thank you!