Maybe i'm missing something stupid, but the example in your docs is more complicated than I need - it appears to target slices by name, index, or type? not sure what I would pass for these values, and I don't need to target any particular slice in this case. There's also mention of a resolver function, is that still neccesary? I see now your example project passes components, perhaps instead?
Some slightly more complete / up to date documentation would help here!
Thanks @Pau, but perhaps my ImageBlock slice is a distraction here. Im definitely using <PrismicNextImage> within it, and have other reasons to make a custom slice for it.
What I really need to know is for this slice, and others, how I can get the value of highlightBG which is defined at the page level.
It is a top level field outside of a Slice, if that's the case then you just need to retrieve the data in project, then you should be able to find those fields in the first or second node of the response object. Have you tried to log the response in the terminal?
Hmm no i'm not sure how I would do that... how do I access the response to log it from inside a slice component?
What is wrong with using sliceProps? it seems like the thing I should be using... does it not work? is it deprecated??
Basically i have 'project' pages which are like the example project blog post pages. Each project has a custom highlight color, some set stuff at the top of the page, and then slices that alternate between image and text blocks.
Sometimes those slices need to use the highlight color in their css. I can think of some hacky ways I might be able to acheive this, but passing the highlight color from the project page wrapper -> <SliceZone> -> slices seems clean? if it works!