# Getting started with integration using React

**URL:** https://forum.builder.io/t/getting-started-with-integration-using-react/2754
**Category:** Technical Questions
**Tags:** react
**Created:** [October 17, 2022, 5:49pm UTC](https://forum.builder.io/t/getting-started-with-integration-using-react/2754 "2022-10-17T17:49:02Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![georgeftakla](https://avatars.discourse-cdn.com/v4/letter/g/49beb7/32.png) [@georgeftakla](https://forum.builder.io/u/georgeftakla)
#### Post date: [October 17, 2022, 5:49pm UTC](https://forum.builder.io/t/getting-started-with-integration-using-react/2754/1 "2022-10-17T17:49:02Z")

</div>

_Please fill out as many of the following questions as possible so we can help you promptly! If you don’t know how to answer or it does not apply, feel free to remove it or leave it blank._

**Builder content link**

> **[Integrating Pages - Builder.io](https://www.builder.io/c/docs/integrating-builder-pages)**
>
> Build and optimize digital experiences for any tech stack, visually.

**Builder public api key**  
_go to [Builder.io: Drag and drop Visual CMS](https://builder.io/account/organization) and copy your PUBLIC api key_

**What are you trying to accomplish**  
Use the integration tutorial’ of React code in VSCode that flag “async” as "un

**Screenshots or video link**  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/6/66538426ac9e4ea580edb29744b1c5e21b9e72ae.png)

_Screenshots of your issue, or even better a link to a video of what is happening or what you are trying to accomplish. We love using loom for that sort of thing_  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/6/6867858b5b27a4bb3b2339ce4371f5e85c255702.png)

**Code stack you are integrating Builder with**  
react

**Reproducible code example**  
_If you are having integration errors, please link to codesandbox or copy and paste your problematic code here. The more detail the better!_

import { BuilderComponent, builder, useIsPreviewing } from ‘@builder.io/react’;

// Put your API key here  
builder.init(‘I removed my API key’)

// set whether you’re using the Visual Editor,  
// whether there are changes,  
// and render the content if found  
export default function CatchAllRoute() {  
const isPreviewingInBuilder = useIsPreviewing();  
const [notFound, setNotFound] = useState(false);  
const [content, setContent] = useState(null);

useEffect( () =\> {  
async fetchContent {  
const content = await builder.get(‘page’, {  
url: location.pathname  
}).promise();

```
  setContent(content);
  setNotFound(!content);
}

```

}, [location.pathname]);  
// if no page is found, return a 404 page  
if (notFound && !isPreviewingInBuilder) {  
return   
}

// return the page when found  
return (  
\<\>  
  
{content?.data.title}  
  
{/\* Render the Builder page \*/}  
  
\</\>  
);  
}

---

<div class="post-metadata">

### Author: ![nicke920](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@nicke920](https://forum.builder.io/u/nicke920)
#### Post date: [October 17, 2022, 8:22pm UTC](https://forum.builder.io/t/getting-started-with-integration-using-react/2754/2 "2022-10-17T20:22:29Z")

</div>

Hi George,

Thank you so much for reaching out! I’d gladly love to assist.

It looks like in the code it is missing calling the fetchContent function from within useEffect() hook. I’ve linked a CodeSandbox link with a working React integration for reference: [https://codesandbox.io/s/builder-react-integrating-pages-2-kp19hb?file=/ src/App.js:0-1220](https://codesandbox.io/s/builder-react-integrating-pages-2-kp19hb?file=/src/App.js:0-1220)

Please let me know if this helps. If this doesn’t work, please share a link to your content and we can take a further look.

Thanks.

![Screen Shot 2022-10-17 at 1.22.16 PM](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/b/bcae99c2c890d553116a9a8a993df6315773bbbd.png)

---

<div class="post-metadata">

### Author: ![georgeftakla](https://avatars.discourse-cdn.com/v4/letter/g/49beb7/32.png) [@georgeftakla](https://forum.builder.io/u/georgeftakla)
#### Post date: [October 19, 2022, 1:58pm UTC](https://forum.builder.io/t/getting-started-with-integration-using-react/2754/3 "2022-10-19T13:58:35Z")

</div>

It works … thank you!
