Can't use React state on SpreadJS events

Posted by: ngocnguyen09910060 on 16 July 2022, 2:17 am EST

  • Posted 16 July 2022, 2:17 am EST

    Hi teams,

    On my web application, i create state:

    const [point, setPoint] = useState<number[]>([]);
    

    I have a button. When user click button, i will set state as below:

    setPoint([9, 10])
    

    In all events of SpreadJS (such as: rangeChanged, cellChanged,…), when i get point, it’s always return (initial state).

    How can i get and use React state on SpreadJS events ?

  • Posted 18 July 2022, 5:56 am EST

    Hi,

    We are sorry but we are unable to replicate the issue on our end. Could you please share a working sample that replicates the issue so that we could investigate it further and help you accordingly? You may edit the following sample that we used for testing.

    sample: https://codesandbox.io/s/react-typescript-forked-ytv1t?file=/src/index.tsx

    Regards,

    Avinash

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels