React not loading on suer edit page
-
Hello,
I am experiencing an issue with my custom WordPress theme where I use React to create a custom component. Specifically, I encounter problems when trying to insert this component on the user edit page using the “edit_user_profile” action.
Here are the details of the issue:
- Problem: When inserting the React component on the user edit page, elements from the WordPress React Library, such as ToggleControl, are not working. I receive the following error: “Cannot read properties of undefined (reading ‘ToggleControl’)”. Additionally, apiFetch is not functioning as expected on this page.
- Working Scenario: Interestingly, the same React component works perfectly when used on a LearnDash course page.
I would appreciate any guidance or suggestions you can provide to resolve this issue. Specifically, I would like to understand:
- Why the React components from the WordPress library are not recognized on the user edit page.
- How I can properly include and utilize these components in this context.
Thank you for your time and assistance. I look forward to your response.
Best,
Marius
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- You must be logged in to reply to this topic.