Start a new topic
iink SDK Web
In ReactJS v18.0.0, there is a recommendation that ReactDOM.createRoot should be used to create the root container for rendering:
const root = ReactDOM.createRoot(document.getElementById('root'));root.render( <React.StrictMode> <App /> </React.StrictMode>);
I created a local project using the iink web example from CodeSandbox.io to test this recommendation (https://codesandbox.io/s/react-test-3vkn9x9n1m?file=/src/App.js). Here are some code snippets:
package.json:
index.js:
App.js:
After running this project by npm start, an error occurs with this message:
Uncaught TypeError: this is undefined
So one would think to remove the this object and fix this problem:
But after running npm start, as soon as a stroke is created using stylus or mouse in the editor, it causes a new error from iink.js:
Uncaught TypeError: s.currentStroke is undefined
So, either way with or without this object in this.editor.close(), there is always an error when using iink.js under reactJS v18.0.0.
Can you help to resolve this issue?
Hello,
We did not reproduce your issue with your code neither with react 18.0.0 nor with react 18.2.0, neither with iink-js nor with iink-ts 1.0.3.
You can refer to this iink-ts example that works.
Best regards,
Gwenaëlle
Brainstrong911
In ReactJS v18.0.0, there is a recommendation that ReactDOM.createRoot should be used to create the root container for rendering:
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);
I created a local project using the iink web example from CodeSandbox.io to test this recommendation (https://codesandbox.io/s/react-test-3vkn9x9n1m?file=/src/App.js). Here are some code snippets:
package.json:
index.js:
App.js:
After running this project by npm start, an error occurs with this message:
TypeError: this is undefined
So one would think to remove the this object and fix this problem:
But after running npm start, as soon as a stroke is created using stylus or mouse in the editor, it causes a new error from iink.js:
TypeError: s.currentStroke is undefined
So, either way with or without this object in this.editor.close(), there is always an error when using iink.js under reactJS v18.0.0.
Can you help to resolve this issue?