tameemsafi / typewriterjs

A simple yet powerful native javascript plugin for a cool typewriter effect.
https://www.npmjs.com/package/typewriter-effect
MIT License
2.46k stars 220 forks source link

TypeError: Super expression must either be null or a function #194

Closed diptasahacse closed 1 year ago

diptasahacse commented 1 year ago

I am getting issues while using in Next JS,

Type.tsx import React from "react"; import Typewriter from "typewriter-effect"; const Type = () => { return ( <Typewriter options={{ strings: ["JavaScript", "TypeScript", "React", "NextJS", "NodeJS"], autoStart: true, loop: true, deleteSpeed: 50, }} /> ); };

export default Type;

I used that components in another component like,

Hero.tsx

import React from "react"; import Type from "../Shared/Type"; const Hero = () => { return (

); };

export default Hero;

Al-Ghoul commented 1 year ago

Add 'use client'; to the top of your file.

sangayt1997 commented 9 months ago

"use client" on top of file work well in my case. Thank you @Al-Ghoul

nishantshah977 commented 6 months ago

"use client" isn't working for me. I tried add it in page.js but didn't work. I also created a new file used "use client" and exported in page.js but it also didn't work.