Skip to content

Conversation

Hyperkid123
Copy link
Member

Changes

  • rewrite mappers FormTemplates to be components.
  • onStateUpdate is back as a FormRenderer prop

@Hyperkid123 Hyperkid123 added renderer React form renderer PR V2 labels Mar 4, 2020
@Hyperkid123 Hyperkid123 requested a review from rvsia March 4, 2020 11:42
@Hyperkid123 Hyperkid123 force-pushed the fix-template-re-render branch from ed46784 to 820c44b Compare March 4, 2020 11:46
@codecov
Copy link

codecov bot commented Mar 4, 2020

Codecov Report

Merging #352 into v2 will increase coverage by 0.09%.
The diff coverage is 91.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##               v2     #352      +/-   ##
==========================================
+ Coverage   86.46%   86.56%   +0.09%     
==========================================
  Files         127      128       +1     
  Lines        2025     2039      +14     
  Branches      649      649              
==========================================
+ Hits         1751     1765      +14     
  Misses        274      274
Impacted Files Coverage Δ
...i-component-mapper/src/components/form-template.js 81.81% <100%> (+1.81%) ⬆️
...4-component-mapper/src/components/form-template.js 100% <100%> (ø) ⬆️
packages/common/src/form-template.js 85.36% <100%> (+3.31%) ⬆️
...3-component-mapper/src/components/form-template.js 93.75% <100%> (+0.41%) ⬆️
...react-form-renderer/src/hooks/use-component-spy.js 80% <80%> (ø)
...eact-form-renderer/src/components/form-renderer.js 95.65% <87.5%> (+0.91%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ca49cf...cbe0612. Read the comment docs.

<FormTemplate formFields={renderForm(schema.fields)} schema={schema} />
</RendererContext.Provider>
)}
render={({ handleSubmit, pristine, valid, form: { reset, mutators, getState, submit, ...form }, ...state }) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary return block

@Hyperkid123 Hyperkid123 force-pushed the fix-template-re-render branch from 820c44b to 0b85610 Compare March 4, 2020 11:55
@@ -10,9 +10,35 @@ import defaultSchemaValidator from '../parsers/default-schema-validator';
import SchemaErrorComponent from '../form-renderer/schema-error-component';
import defaultValidatorMapper from '../validators/validator-mapper';

const useComponentSpy = (onStateUpdate) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about to move this to hooks folder?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could. If you reaaaaaally want me to

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please :D

@Hyperkid123 Hyperkid123 force-pushed the fix-template-re-render branch from 0b85610 to 7b45b75 Compare March 4, 2020 12:04
@Hyperkid123 Hyperkid123 mentioned this pull request Mar 4, 2020
@@ -1185,7 +1185,7 @@ describe('renderForm function', () => {
});
});

it('should use actionMapper', () => {
it.only('should use actionMapper', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only ?

@rvsia rvsia self-requested a review March 4, 2020 12:43
@Hyperkid123 Hyperkid123 force-pushed the fix-template-re-render branch from 7b45b75 to cbe0612 Compare March 4, 2020 12:45
Copy link
Contributor

@rvsia rvsia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KA-:boom:

@rvsia rvsia merged commit 811e042 into v2 Mar 4, 2020
@Hyperkid123 Hyperkid123 deleted the fix-template-re-render branch March 4, 2020 13:02
@Hyperkid123
Copy link
Member Author

🎉 This PR is included in version 1.31.0 🎉

The release is available on

Demo can be found here!

@Hyperkid123
Copy link
Member Author

🎉 This PR is included in version 2.0.0 🎉

The release is available on

Demo can be found here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released renderer React form renderer PR V2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants