stephenscaff / react-animated-cursor

An animated custom cursor React component.
ISC License
273 stars 28 forks source link

Please Add Typescript support #28

Closed MightyCryptowall closed 11 months ago

Thremulant commented 1 year ago

hey @MightyCryptowall I converted this package to TS and published FOR TESTING purposes, can you please give it a try? It has been working on a couple of CRA projects with and without TS, but I'd like other users to try it.

Here's the link: react-animated-cursor-ts

MightyCryptowall commented 1 year ago

@Thremulant there is some error in SSR i have been working with nextjs

Screen Shot 2022-09-09 at 13 31 26
Thremulant commented 1 year ago

@MightyCryptowall expected, as the files no longer have a default module. Try it using the named export:

const AnimatedCursor = dynamic(() => import('react-animated-cursor-ts')
  .then((mod) => mod.AnimatedCursor), {
  ssr: false
});

Dynamic Import with named export - NextJS Documentation

MightyCryptowall commented 1 year ago

@Thremulant, It works. thx

stephenscaff commented 11 months ago

Updated to TS Ya'll. Just published v 2.7.0 with has TS support.

I made various updates before migrating to TS (most importantly changing how the scale animation worked to address a known safari bug causing blurring), in addition to upgrading all the deps to latest (including moving to rollup v3), so couldn't just accept @Thremulant's PR as is. But, used that as my starting point, so super grateful for the help.

Give it a shot. Let me know if you have any issues / suggestions.

Thanks.