React detector

React logo

How can you detect if a website uses React by looking at the source code?

Detecting whether a website is built using React can be accomplished by examining specific indicators within the website’s page source.

Here’s a step-by-step guide on how to do it:

  1. Open the Page Source: Right-click on the webpage and select “View Page Source” or press Ctrl+U (Windows) or Cmd+Option+U (Mac) to open the page’s source code.
  2. Look for React-Specific Markers: Search for attributes that are unique to React. Use Ctrl+F (Windows) or Cmd+F (Mac) to open the search function and look for the following keywords:
    • data-reactid: This attribute is a common indicator that the website is using React for its component rendering.
    • React: Look for occurrences of the word ‘React’ in the scripts or JavaScript code. You might see references to React libraries, such as react-dom.
  3. Check for React DevTools: If you’re using Google Chrome or Firefox, you can install the React Developer Tools extension. Once installed, navigate to the website and open the Developer Tools (press F12 or Ctrl+Shift+I). If the React tab is available in the DevTools, the website is built with React.
  4. Look for JavaScript Bundles: Many React applications are bundled using tools like Webpack or Parcel. Check the source code for JavaScript files that have names like bundle.js or main.js, which often indicate a single-page application structure.
  5. Search for React Libraries: Look for links to CDN files that contain React libraries in the source code. For example, you may find something like: <script src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
  6. Inspect the HTML Structure: React usually renders its elements using a <div id="root"> or similar container. Check if the main HTML structure contains a div or similar container where the React components are mounted.
  7. Check for Component-Based Architecture: Look for a clear separation of HTML-like syntax in the JavaScript code, often using JSX. This could be in the form of <MyComponent /> syntax within the scripts.