Hi,
sorry for a stupid question, but I always stumble again and again over the problem, that in Javascript code often is simplified to the point of unrecognizability - I am an old JEE developer
I try to implement a custom renderer and take the Ranking example as a base. To keep my code more compact I put the React FunctionalComponent and the Control element into one single file (module).
But I was not able to put also the Tester into my module and out of a separate file.
Can someone explain me how I can define a export (not a default) in my custom Renderer module that provides an equal tester without the need to put the tester into a separate file. Or is there some deeper meaning to it?
I am really sorry about this question, but I canât find any information about the general functionality of the Tester. I can see in the sources that there is some other layer providing the Schema and UISchema which may be useful to implement a more intelligent testing.
It may be, that this solution is obvious to many of you, but it helps me a lot in understanding code, if I combine the behavior of one custom renderer in one single module.
yeah the code base is sadly a bit all over the place on where each renderer and tester is located.
Instead of exporting the renderer and tester separately (or maybe in addition to it) you could also export the whole âentryâ, i.e. the { renderer, tester} object so that you donât need to construct that in place.
Instead of any you can use JsonFormsRendererRegistryEntry. For application code keeping the renderer and tester private is totally fine. Should you work on a library, e.g. a renderer set shared over multiple applications, you probably want to export the unwrapped version of the renderer too so it can be more easily reused if the need arises.