Find the rank of a given renderer

I am writing a custom renderer for the “anyOf” properties.and by trial and error I found out that the rank of my custom component needed to be 4 otherwise it wouldn’t be rendered.

My question is : where can I see what are the rank of the already available renderers ? (I’m using material renderers but the questions is quite general)

Hi @Jojain,

unfortunately there is no universal directory to find this out. You can see it by looking at the source file of the original renderer. Usually, every renderer exports a tester defining its rank. For instance, this is defined here for the material any of renderer.

Generally, all default renderers use quite low ranks with values < 10. So if you use a rank higher than that you should be good :slight_smile:

Hope that helps and best regards,

Note that if you don’t really care about the rank but just want to overwrite the existing tester, then you can use withIncreasedRank, e.g.

const myTester: RankedTester = withIncreasedRank(1, existingTester);
1 Like

Thanks that’s probably the best option !