Earlier you might have been using constructor.name === "SceneNode" instead of constructor === scenegraph.SceneNode. Sorry, I should have mentioned that as a workaround in my last post.
Actually, just checked timeline, and I was using it successfully 8 months ago as
import { SceneNode } from 'scenegraph'
{shrug?}.
I donāt know if youāre using the Typescript Definitions?
If so, there was an issue with SceneNode being declared as a class (as it got documented this way, I actually today see this as an issue with the docs back then) in the definitions until a few months ago (then, I changed it to now change it back with it actually getting exported
).
Therefore, no errors got shown when importing it. However, its value then has been undefinedā¦
Not not using Typescript, though Iād love to. Just havenāt taken the plunge (since Iāll then have to figure out/find definitions for everything else Iām using).
At my next āpause pointā I may try.
Iām using the latest.
I tested it and it seems to be working but the error might be because Iām using an older typescript definitions that @pklaschka mentioned he has updated but I have not updated. I have not updated because it was causing some other issues I donāt remember but the code is work now.
const { SceneNode } = require("scenegraph");
if (item instanceof SceneNode) { log("it is a scene node"); }
@peterflynn Should I use this instead:
if (node.constructor === scenegraph.SceneNode)