• I am fed up from custom website errors and want to convert from react to wordpress again because wordpress manage everything by itself automatically and i like it!!!

    I discussed with developement experts to do it for me but they rejected and said the below given function is not working as per your requirement, they reverted back all but my few pages are now not getting indexing

    import React, { useEffect, useState } from ‘react’; const WordPressReactComponent = () => { // Error 1: State initialization const [postData, setPostData] = useState([]); // Error 2: Incorrect useEffect dependency array useEffect(() => { // Error 3: Fetching data from the WordPress REST API fetch(”) .then(response => response.json()) .then(data => setPostData(data)) .catch(error => console.error(‘Error fetching data:’, error)); }, []); // Make sure to add dependencies if needed return ( <div> {/* Error 4: Rendering data from state */} {postData.map(post => ( <div key={post.id}> <h2>{post.title.rendered}</h2> {/* Error 5: Incorrectly rendering content */} <div dangerouslySetInnerHTML={{ __html: post.content.rendered }} /> </div> ))} </div> ); }; export default WordPressReactComponent;

    Please any expert who knows about it help me for this, Thanks!

    • This topic was modified 1 year, 2 months ago by wasi5544332211. Reason: wordpress post url was added, wordpress not allow links

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

Viewing 1 replies (of 1 total)
  • Moderator James Huff

    (@macmanx)

    This problem may be a plugin or theme conflict. Please attempt to deactivate all plugins and switch to the default Twenty Twenty-Three theme. If the problem goes away, re-activate them one by one to identify the source of the problem.

    If you can install plugins, install Health Check. On the troubleshooting tab, you can click the button to deactivate all plugins and change the theme for you while you’re still logged in without affecting normal visitors to your site.

Viewing 1 replies (of 1 total)
  • The topic ‘Convertion of Website into WordPress’ is closed to new replies.