rockiger
Forum Replies Created
-
Have a look into the source of the generated page. The var is called
reactPress
.You should be able to access it directly or with
window.reactPress
.It has two properties user and
usermeta
.If the user is logged in, the holds the user data, otherwise, they are empty.
You can do any call to the WordPress API. There are no limitations there.
I am sorry. I don’t know if it is something strange with AWS. Maybe some security measure that you are not allowed to serve javascript files from the apps location?
But this is just guessing.
Forum: Plugins
In reply to: [ReactPress - Create React App for Wordpress] Problem after running npm startCould you look into the debug.log, something in there, that gives a reason why it doesn’t work?
First build === initial build. If you say, you can see the React app in your WP page, this app had to be built before, right. This means ReactPress is working.
Now to reflect changes that you did with the create-react-app dev server in your app, it has to be built again. This updated build has to be uploaded to your WP site.
I created 2 new videos on how to get started with ReactPress and how to deploy apps. Maybe the make things clearer:
It seems to be react-scripts don’t see the changes of your source code.
If the first build works and the second doesn’t this shouldn’t have something to do with ReactPress.
Did you try to delete your build folder and then rebuild the app?
But you can see the initial build?
Forum: Plugins
In reply to: [ReactPress - Create React App for Wordpress] Problem after running npm startOdd, there seems to be some problem for ReactPress to connect to your local WordPress installation. Which is very odd, because ReactPress is running on that installation.
Did you try it with LocalWP?
Forum: Plugins
In reply to: [ReactPress - Create React App for Wordpress] Problem after running npm startCan you post a screenshot?
Forum: Plugins
In reply to: [ReactPress - Create React App for Wordpress] Problem after running npm startNo, this shouldn’t be a problem. You should start with create-react-app in you local system. But your react-app needs to be in the apps folder of your WordPress dev system. Otherwise, it can’t work. Please check with the instructions.
You need to follow them to the letter:
- Install ReactPress on your local WordPress installation
- Use create-react-app from the command line in the apps folder shown in ReactPress
- Reload ReactPress page and give the app a slug
- Develop your React
- Build the app
- Install ReactPress on live WordPress site
- Create the same folder there (no need for create-react-app) there
-
Upload the build folder of your React app into the created folder.<br>
Reload ReactPress page and give the app the SAME slug.
Sorry, I am bit short on time right now.
What is the whole outpout of useParams and useLocation?
Probably your Rout should be something like this in the live environment:
<Route path="/reactpressapp/:id" component={SurveyPage}></Route>
Best
MarcoForum: Plugins
In reply to: [ReactPress - Create React App for Wordpress] Problem after running npm startHm, this is odd.
npm start
should only start the dev server for React app. Could you look intopublic/index.htlm
. How does this file look like? The idea is, that when you are setting the slug theindex.html
gets updated to look like your WP site.And as a site note, I would use localWP as a dev server for WordPress. This is an easy to maintain proven dev environment.
Assuming that you use React-Router try to go to Settings > Permalink in your WordPress and save the settings there again. This rewrites the permalink cache.
If this doesn’t help, post the code you are using here.
You don’t need to use react-page-template. You can use any template you want. Just make sure the content of the page is the same.
Forum: Plugins
In reply to: [ReactPress - Create React App for Wordpress] Deployment issueAs always, I would recommend to LocalWP instead of Xampp.
Plain Windows is not supported. I don’t have a Windows machine and can’t debug this.
Best
MarcoForum: Plugins
In reply to: [ReactPress - Create React App for Wordpress] issue with reactpress plugin.Can you activate debug mode for WordPress? I suspect that there is some underlying PHP error before. The JSON problem is only a result of that.