Chosen Solution

I have an iPhone 8 Plus that I got handed down from someone I had to replace the back glass but the rear camera was torn out and the flash was broken. I now have an old iPhone 7 Plus with a camera that works I was wondering if I could replace the missing iPhone 8 Plus with the iPhone 7 Plus camera, thank you for any help

No they are not compatible. The connector might fit but the circuitry is different.