If you replace iPhone 8, 8 plus or X screen you need to copy the firmware data of the original screen into the new screen. The needed tool is under development. I saw some working versions, what are tested and working with IOS 11.4 and 12.0 Beta. The screen data can be cloned only to OEM screens for now.
Afte the copy of the data, the light sensor works well again.
If you would like to know more about this problem read this article: http://www.futuresupplier.com/blog/solved-iphone-88plusx-ambient-light-sensor-failed-problem/
If you need an ALS box, you can order here: http://www.futuresupplier.com/iphone-8-8-plus-x-3-in-1-als-ambient-light-sensor-programmer-box.html