k1ngy.eth Posted June 8, 2022 Share Posted June 8, 2022 C:/Working Folder/Website/WebPortal/Portal/ClientApp/src/components/salesPage/SalesIntro.tsx TypeScript error in C:/Working Folder/Website/WebPortal/Portal/ClientApp/src/components/salesPage/SalesIntro.tsx(43,6): Type 'RefObject<HTMLDivElement | undefined>' is not assignable to type 'string | Element | ArrayLike<string | Element | null> | null | undefined'. Property 'length' is missing in type 'RefObject<HTMLDivElement | undefined>' but required in type 'ArrayLike<string | Element | null>'. TS2322 41 | duration: 1.5, 42 | scrollTrigger: { > 43 | trigger: leftEl, | ^ 44 | }, 45 | }, 46 | }); https://stackoverflow.com/questions/72542030/type-refobjecthtmldivelement-is-not-assignable-to-type-domtarget-undefine Please answer the question on stackoverflow or here. This is blocking me badly! Link to comment Share on other sites More sharing options...
Cassie Posted June 8, 2022 Share Posted June 8, 2022 This would suggest to me that the element doesn't existProperty 'length' is missing in type 'RefObject<HTMLDivElement | undefined>' Is you log it out what do you get? (Maybe it should be leftEl.current) 1 Link to comment Share on other sites More sharing options...
GreenSock Posted June 8, 2022 Share Posted June 8, 2022 Yeah, it sure sounds like you're using React and passing in a ref instead of a valid target element (like Cassie said, leftEl.current) 1 Link to comment Share on other sites More sharing options...
k1ngy.eth Posted June 9, 2022 Author Share Posted June 9, 2022 That was it! Thank guys 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now