You have been tasked with making changes to an existing page on your company website.
- When the user clicks this image, instead of this image modal, have it load up a React component.
Initially, this seems pretty straightforward. Just find the code that renders this and swap out part of it.
Well... Depending on the number of methods by which you are generating DOM elements(external libraries, JSON, HTML, serverside templates, client side templates) It may become a little complicated.
Here's a process that's working well for me:
- copy a snippet from the rendered DOM right where you will need to edit. (a title for the modal that pops up, for example)
- In this case, let's imagine you copied 'Large Waterbottle'.
- Full source search in chrome dev tools. (in Console, hitting ctrl + shift + F) Shows what file it came from (Finding text rendered in server templates this way and digging into server templates)
- Search network tab