I need to manipulate the children of some of my page elements using the render method https://docs.plasmic.app/learn/react-api/
I can access the children with no problem when the element is declared within the page (vegetables). But if my element is declared as a component (fruits), then the children are not accessible (I think it use to be accessible )
@plasmicapp/loader-gatsby: tried 1.0.179 and 1.0.203
Hello @mighty_donkey. This is because fruits is not receiving anything in props.children. Since it’s a component, you can only change it by using it’s props. To make this work, you can create a slot inside fruits called children, and then you would have access to it.
Though there is still an issue when several components share the same name in a page.
Everything works fine when only one instance of fruits is present in my page (first pictures)
When two instances of fruits are present in my page, the render method is not called at all and my components are displayed on the page while it shouldn’t (last pictures).
When there are multiple components of the same name, you need to double click the element in the tree or in the right panel and rename it. Then, you’ll be able to access it in code by the name you gave it
Yes I noticed that. Though, I’d like to apply the same treatment to all the instances of the same component on my pages. Without having to anticipate different names for different instances. Is it possible?