• dteglbjaerg

    (@dteglbjaerg)


    Hi there!

    First of all, thank you very much for this plugin. This is exactly what I’ve been looking for. I’m new to react dev in WP, so bare with me if this is a no-brainer.

    So, I’ve successfully created and setup a react app on a fresh WP install using WPlocal and following your guide. Everything words very nicely and smooth there.

    However I want to use ReactPress to develop af more dynamic dashboard page on my existing WordPress site. The site is a members only site and the dashboard would sit behind an existing login page (created in WP). I cannot get this to work. This is what I’m doing:

    1. I create the react app as shown in the guide for a local version of my membership site (hosted using Local)
    2. I navigate to the folder and run yarn start
    3. I go to localhost:3000 and I’m immediately redirected to the existing WP member login page. Url is still localhost:3000
    4. I enter my login details, but I get an error saying cookies needs to be activated for wordpress to work
    5. When the error happens the login page is automatically reloaded, but now the domain is the one set i Local, not localhost:3000 (something like my-domain.local)
    6. Now the login works, but when I land on the dashboard page (my-domain.local/dashboard) where the react app should be running, nothing is showing.

    Now if I do a manual build (yarn build) of the app, then I can navigate to my-domain.local/dashboard and see the react app, but I don’t want to develop having to do a build each time I need to see the changes I’ve made.

    Do you have any idea what I can do here?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter dteglbjaerg

    (@dteglbjaerg)

    If I look at the content of the index.html file, it contains the html of the login page my site. The site my-domain.local/dashboard contains, the reactpress block with <div id=root></div>

    Plugin Author rockiger

    (@rockiger)

    Hi,

    the problem is ReactPress can’t download your protected dashboard page. You need to:

    1. un-protect the dashboard,
    2. update the page contents in ReactPress admin
    3. re-protect the dashboard again.

    On step 2 ReactPress will download the WordPress content of the dashboard and inject the React app into the index.html page. After that, you should be fine with hot-reloading on https://localhost:3000.

    Hola @rockiger, no me deja instalar un proyecto de react desde un proyecto que estoy trabajando en un proveedor de hosting, me dice que el archivo de la ruta no lo reconoce la terminal, en cambio si lo hago desde xampp con un WordPress de prueba en mi maquina local si funciona. Como puedo agregar en hosting.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘React app behind login page’ is closed to new replies.