With the corrections of the file path (dot and semicolon), require type imports are the old style which isnt typically used in react. If applied correctly you would have to use:
var img = require('../../assets/images/icon.png');
For this to work, you need to have the property type in your package.json defined with commonjs :
"type": "commonjs"
the prefered approach for react and generally javascript is the module import, for that you need to change the type property to the following:
"type": "module"
Then you can import like you'd usually do within react:
import img from '../../assets/images/icon.png';
Your path should otherwise be correct. You can check this by holding CMD on Mac or CTRL on Windows/Linux and the clicking the part of your path you want to jump to. That's how you can check if it lands where it should without code execution