Threejs for Ionic4 possible?

#1

Hi there,

Is using ThreeJS in Ionic4 possible?
I see that Ionic4 now only supports TypeScript and ThreeJS is javascript based library.

Do you think I can import ThreeJS and use it in a .js file to implement a ThreeJS scene and render within Ionic4??

Does anybody has tried it before?

#2

Hello,
I never used threejs, but any common js library should work with typescript too ( in the end all is transpiled into js). What sometime is difficult, is how to install and import the library. But luckily https://threejs.org/docs/index.html#manual/en/introduction/Import-via-modules shows how to do it with npm and use it as es 6 module.

Best regards, anna-liebt

2 Likes