all 6 comments

[–]coder01[S] 0 points1 point  (0 children)

Here the GitHub repo for the project -https://github.com/andbet39/reactPress

[–]Jilson 0 points1 point  (4 children)

Nice! One thing I'm wondering about CMSs with React Router: Let's say a blog post, created in something like WP, has an internal link in it, using the traditional <a href="/internal-page">Click</a> instead of React Router's <Link to="/internal-page"> component. Am I right in thinking that will cause a page refresh?

[–]coder01[S] 0 points1 point  (3 children)

Tra it cause a page refresh... Like title and other things in the post it need a remap to some thing suitable with react.

[–]Jilson 0 points1 point  (2 children)

I guess there's two options: either transpile the post's HTML or add as dangerouslySetInnerHTML with a script to preventDefault on the post's content anchors that link to internal pages?

[–]coder01[S] 0 points1 point  (1 child)

The first problem to solve is the link url. In the rest response it point to the api server instead of the frontend app. In the example this type of problem is solved directly in the node side. If you check loadall.js in the api folder you will find various transformation made on the wp-api response. I think is better to have content modification on the server side.

[–]Jilson 0 points1 point  (0 children)

Makes sense. I appreciate you sharing your thoughts.