Note: Im using NextJs (Pages router)
On the Integrating structured data page, there’s an example of how to get the data for the component in the code.
In the example, a custom component of a navbar use the values from the cms-data by calling builder.getAll
.
With builder.io’s native components such as Image, i don’t have access to the component code so i can’t use builder.getAll
to get the values i need from the cms-data.
What i do today is a fetch
call on my page to get all my cms-data and then i filter the data and pass it to the page’s BuilderComponent
data
prop.
This way i have access to this data anywhere on my page by referencing the state
.
Is there a way to use my cms-data values in the editor without doing this fetch
call and passing the data down to the page?
It feels like im defining the data in builder.io, fetching the data, and passing it back down to the editor. Is this roundtrip necessary? or is there a way to use/reference my cms-data directly in the editor?