Skip to content

Releases: payload-code/payload-react

v1.2.6

03 Mar 01:40
v1.2.6
c0212d6

Choose a tag to compare

What's Changed

Highlights

  • Exposed Payload.js Form.submit function:
function Checkout() {
  const formRef = useRef(null);

  const manualFormSubmit = async () => {
    try {
       const result = await formRef.current.submit()
       console.log('SUCCESS', result)
    } catch(e) {
       console.log('ERROR', e.data)
    }
  }

  return <div>
    <PaymentForm ref={formRef}>
      <Card/>
    </PaymentForm>
    <button type="button" onClick={manualFormSubmit}>Submit</button>
  </div>
}
  • Enable onInvalid and onValid events to fire on all payload inputs, not just sensitive inputs
function Checkout() {
  return (
    <PaymentForm ref={formRef}>
      <PayloadInput attr="amount" onInvalid={(evt)=>console.log(evt.message)}/>
      <Card onInvalid={(evt)=>console.log(evt.message)}/>
      <button>Submit</button>
    </PaymentForm>
  )
}

Other updates, features, and bug fixes:

  • Forwarded ref for higher order form components (PaymentForm and PaymentMethodForm)
  • Fixed issue with payment and paymentMethod props not updating on rerender
  • Added docstrings to components and functions
  • Delay initalizePayload until clientToken and Payload.js are present

Commits:

  • Bump nanoid from 3.3.6 to 3.3.8 in /examples/react-18 by @dependabot in #65
  • Bump nanoid from 3.3.6 to 3.3.8 in /examples/react-16 by @dependabot in #67
  • Bump cookie and express in /examples/react-16 by @dependabot in #66
  • Bump cross-spawn from 7.0.3 to 7.0.6 in /examples/react-18 by @dependabot in #63
  • Bump path-to-regexp and express in /examples/react-18 by @dependabot in #64
  • Bump http-proxy-middleware from 2.0.6 to 2.0.7 in /examples/react-18 by @dependabot in #62
  • Updates for v1.2.6 by @ianhalpern in #68
  • Bump cross-spawn from 7.0.3 to 7.0.6 in /examples/react-16 by @dependabot in #70
  • Bump http-proxy-middleware from 2.0.6 to 2.0.7 in /examples/react-16 by @dependabot in #71

Full Changelog: v1.2.5...v1.2.6

v1.2.5

16 Oct 15:58
0d82667

Choose a tag to compare

What's Changed

  • Upgrade node version to v20.17.0 by @jcar787 in #57
  • Add new options preventDefault and preventSubmit to React library by @NathanYearout in #55

Full Changelog: v1.2.4...v1.2.5

v1.2.4

25 Jun 01:07
df643e3

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.2.3...v1.2.4

v1.2.3

21 May 20:19
d4f5db7

Choose a tag to compare

What's Changed

Full Changelog: v1.2.2...v1.2.3

v1.2.2

12 Apr 19:09

Choose a tag to compare

What's Changed

  • Add Checkout and openCheckout wrappers to payload-react. by @jcar787 in #42

Full Changelog: v1.2.1...v1.2.2

v1.2.1

03 Apr 22:35
7967890

Choose a tag to compare

What's Changed

Full Changelog: v1.2.0...v1.2.1

v1.2.0

03 Apr 17:54
9f5cd15

Choose a tag to compare

What's Changed

  • PAY-1201: Add onChange and onSuccess to react components and tests. by @jcar787 in #37
  • Bump follow-redirects from 1.15.4 to 1.15.6 in /examples/react-18 by @dependabot in #33
  • Bump follow-redirects from 1.15.4 to 1.15.6 in /examples/react-16 by @dependabot in #34
  • Bump webpack-dev-middleware from 5.3.3 to 5.3.4 in /examples/react-18 by @dependabot in #35
  • Bump webpack-dev-middleware from 5.3.3 to 5.3.4 in /examples/react-16 by @dependabot in #36
  • Bump express from 4.18.2 to 4.19.2 in /examples/react-16 by @dependabot in #38
  • Bump express from 4.18.2 to 4.19.2 in /examples/react-18 by @dependabot in #39

Full Changelog: v1.1.0...v1.2.0

v1.1.0

14 Mar 13:21
d65744f

Choose a tag to compare

What's Changed

  • Processing Account Form Wrapper by @jcar787 in #32
  • Bump follow-redirects from 1.15.2 to 1.15.4 in /examples/react-18 by @dependabot in #30
  • Bump follow-redirects from 1.15.2 to 1.15.4 in /examples/react-16 by @dependabot in #29

Full Changelog: v1.0.2...v1.1.0

v1.0.2

05 Dec 21:00

Choose a tag to compare

What's Changed

  • Fixed styles form params map and added onAuthorized form event map by @ianhalpern in #28

Full Changelog: v1.0.1...v1.0.2

v1.0.1

04 Dec 01:58

Choose a tag to compare

What's Changed

  • Fix issue with event callback closure on rerender by @ianhalpern in #24
  • Bump json5 from 2.2.0 to 2.2.3 by @dependabot in #11
  • Bump shell-quote and react-scripts in /examples/react-16 by @dependabot in #14
  • Bump loader-utils and react-scripts in /examples/react-16 by @dependabot in #15
  • Bump node-forge and react-scripts in /examples/react-16 by @dependabot in #16
  • Bump @adobe/css-tools from 4.2.0 to 4.3.1 in /examples/react-18 by @dependabot in #20
  • Bump @babel/traverse from 7.22.8 to 7.23.2 in /examples/react-16 by @dependabot in #21
  • Bump @babel/traverse from 7.22.8 to 7.23.2 in /examples/react-18 by @dependabot in #22
  • Bump @adobe/css-tools from 4.2.0 to 4.3.2 by @dependabot in #25
  • Bump @adobe/css-tools from 4.3.1 to 4.3.2 in /examples/react-18 by @dependabot in #26
  • Bump @babel/traverse and @trivago/prettier-plugin-sort-imports by @dependabot in #27

Full Changelog: v1.0.0...v1.0.1