Conversation
|
Looks OK to me. Can we add a brief note to the documentation explaining that this is possible and why you might want to do this? Regarding the commit hook, I've never heard of it accidentally not committing stuff. I'm more familiar with husky committing too much stuff, as in Kinto/kinto-admin#419. |
|
Can we change 'BaseInput' to 'BaseInputWidget' to make it consistent? |
|
That sounds OK to me. |
On the other hand, excluding the "Widget" part in the component/file name communicates that it's not a widget. It isn't a widget because you can't use |
|
Thanks! |
|
I've just updated to the latest version of react-jsonschema-form and faced the issue with Jest snapshot tests. We have a custom widget that is actually a wrapper for original TextWidget. After some investigation, I found out that the reason is that line: Shouldn't default registry be defined as a default prop for TextWidget? I found a workaround providing registry as a property for custom widget but that looks like a hack to me. Please share your thoughts. |
|
The We can't use the default registry as a default, because then the custom fields/widgets wouldn't be used. |
|
@olzraiti, thanks for the response! Shouldn't we define registry as a required propType than? |
|
@anlesk Yes, good idea. Feel free to open a pull request for that :) |
Reasons for making this change
All the other components in registry fields & widgets are overridable. BaseInput shouldn't be an exception. Customizing BaseInput is useful e.g. for propagating changes only on text input blur.
BTW there is something wrong with the npm commit hook - after pushing the first commit I noticed that some files were prettified after pushing, but the prettified changes were in git staging and weren't pushed.
Checklist
npm run cs-formaton my branch to conform my code to prettier coding style