# React / Headless WP Possible?

**URL:** <https://community.localwp.com/t/react-headless-wp-possible/11859>\
**Category:** Support\
**Created:** [April 4, 2019, 3:52pm UTC](https://community.localwp.com/t/react-headless-wp-possible/11859 "2019-04-04T15:52:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LifeLynx](https://avatars.discourse-cdn.com/v4/letter/l/77aa72/32.png) [@LifeLynx](https://community.localwp.com/u/LifeLynx)\
**Post date:** [April 4, 2019, 3:52pm UTC](https://community.localwp.com/t/react-headless-wp-possible/11859/1 "2019-04-04T15:52:43Z")

</div>

I’ve been reading a lot about React and using it as a front-end for WordPress using WordPress’s REST API. Is this possible in Local, and if so, does anyone have step-by-step instructions on how to do it in Local? I’d love to replace PHP with React, at least on the front-end.

Thanks!

---

<div class="post-metadata">

**Author:** ![kingdomcreation](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/kingdomcreation/32/7398_2.png) [@kingdomcreation](https://community.localwp.com/u/kingdomcreation)\
**Post date:** [April 5, 2019, 5:18am UTC](https://community.localwp.com/t/react-headless-wp-possible/11859/2 "2019-04-05T05:18:11Z")

</div>

Sure it’s possible!

Step 1.  
Build a site with React

Step 2.  
Add your data to wordpress

Step 3.  
Using XHTTPRequest call the api endpoints before you mount the components.

Step 4. (optional)  
Create a theme, place your tools and source code inside.

Both technologies are independent from each other and can live together in the same folder. NONE of these are related to Local by Flywheel or even WordPress it all comes down to you being able to create a website with React and using ajax to call the REST API (which could be in Local). Although building a site this way is very unconventional and probably not for the reason you think, it’s still interesting and you could learn a lot this way.

---

<div class="post-metadata">

**Author:** ![warpjams](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/warpjams/32/10236_2.png) [@warpjams](https://community.localwp.com/u/warpjams)\
**Post date:** [April 19, 2020, 7:04am UTC](https://community.localwp.com/t/react-headless-wp-possible/11859/3 "2020-04-19T07:04:42Z")

</div>

OK so what i am wondering is can you load up all the build tools into the local folders so you can run `npx create-react-app myapp` and have it create a local directory called `myapp` what you can then dev your site front end in and then run `npm run build` to create the` build` folder then move the build folder contents to the root of the local wp so that is the index.html file that runs and displays when localhost is called?

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [August 25, 2020, 6:36pm UTC](https://community.localwp.com/t/react-headless-wp-possible/11859/4 "2020-08-25T18:36:42Z")

</div>


