Limenius / liform-react

Generate forms from JSON Schema to use with React (& redux-form)
https://limenius.github.io/liform-react/
MIT License
174 stars 40 forks source link

Customize the Submit Button #36

Closed shuowpro closed 6 years ago

shuowpro commented 6 years ago

I want to wrap this library with my customized component. However, I don't know how to customize the submit button.

Is there any way that I can customize the submit button without changing the source code?

Thanks.

m3doune commented 6 years ago

Hello I've already made a pull request for this purpose, I'm waiting for it's integration.

shuowpro commented 6 years ago

@m3doune I think that might not be a good way to do that. If I want to integrate a button from material-ui or other ui libs. customize only the classname will not solve that problem. I think pass the button as children might be a better way to do that. just like what react-jsonschema-form did.

m3doune commented 6 years ago

@leuction you're right! Pass the button as a children is better.

shuowpro commented 6 years ago

@m3doune I have posted another PR. But it seems that this repo is dead?

nacmartin commented 6 years ago

It is not dead, but I am very busy :/ I have this on my mind quite often, believe me, trying to find some time.

shuowpro commented 6 years ago

Thank you for building this great library. I think it might be great to add the Button to the theme, so that I can install another theme from npm. That might be better than pass it as children.

shuowpro commented 6 years ago

I found out that I can customize the form by pass a props call baseForm.

<Liform
  ...
  baseForm={BaseForm} // you can get this from ./src/index.js
  ...
/>