Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Please update the following components: Cursor #96

Open
BenElferink opened this issue Dec 6, 2020 · 2 comments
Open

Warning: Please update the following components: Cursor #96

BenElferink opened this issue Dec 6, 2020 · 2 comments

Comments

@BenElferink
Copy link

React gave me a warning when using Typist:

Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: Cursor

Here is the code block I'm using:

<Typist cursor={{ show: false }}>
	<h2>
		Hi, my name is Xxx Xxxxxxxx...
		<Typist.Backspace count={12} delay={200} />,
	</h2>
	<h1>
		I'm a Front End Developer!
	</h1>
</Typist>
@donaldboulton
Copy link

Here is my typist code for publiuslogic.com
Hope it helps!

`
import React, { useState, useEffect } from 'react'
import Typist from 'react-typist'

function BioTypist() {
const [count, setCount] = useState(1)

useEffect(() => {
// document.title = You clicked ${count} times;
console.log("Count: " + count);
setCount(1);
}, [count]);

return (


{count ? (
<Typist
avgTypingDelay={50} onTypingDone={() => setCount(29)}
cursor={{ hideWhenDone: true }}
>
I grew up and live in OKC OK!
<Typist.Backspace count={28} delay={800} />

{" "}
Develop Websites with React and {" "}
❤️


) : (
""
)}

);
}

export default BioTypist
`

@ezcg
Copy link

ezcg commented Dec 26, 2021

It'd be great if this repo was updated to fix this error as typist will no longer work after React 18.x per the warning:

  • Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants