I have a scenario like this. Both message and level are coming from props. But I need to log the level only on message value change and when message=== 'data', but not on level change. How can I achieve that? I implemented the useEffect hook like this. But it's giving me this eslint warning React Hook useEffect has a missing dependency: 'level'. Either include it or remove the dependency array. . So, what's the best way to get this fixed ?
useEffect(() => {
if (message === 'data') {
console.log('level : ', level);
}
}, [message]);