Screen sharing is a deep subject. There is:
- Devices with HDMI connectors
- Devices with Type C USB and DisplayPort alternate mode
- Miracast
- Apple mirroring
- Browser-based mirroring, like Chromecast
- Server-based mirroring, like scrcopy
- Screencap mirroring, like my AdbGrab.exe
Your choice depends on quality, latency and reliability required.
When I need to do some screen captures to illustrate something, I use my AdbGrab.exe
It should work with any stock Android, although it is a bit slow.