Create a new file named GoogleTranslate. js in your project's src folder. In this file, we will define our React component. To load the Google Translate script, we will use the useEffect hook, we will pass an empty array as the first argument, so that this effect runs only once when the component is first rendered.