Hello I have problem with this warning, couldn't find a solution in google.
index.js:1 Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://fb.me/react-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://fb.me/react-derived-state Please update the following components: FlipMove
Hello I have problem with this warning, couldn't find a solution in google.
index.js:1 Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://fb.me/react-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://fb.me/react-derived-state Please update the following components: FlipMove
Here is my code.
`const Chat = () => { const [messages, setMessages] = useState(messagesData);
const [errors, setErrors] = useState(null);
const [inputValue, setInputValue] = useState('');
const handleChange = (event) => { setInputValue(event.target.value); };
const messagesEndRef = useRef(null);
const scrollToBottom = () => { messagesEndRef.current.scrollIntoView({ behavior: 'auto', block: 'end', inline: 'end', }); };
const sendMessage = (event) => { event.preventDefault();
};
useEffect(() => { scrollToBottom(); }, [messages]);
return (
); };
export default Chat; `