Releases: payload-code/payload-react
Releases · payload-code/payload-react
v1.2.6
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
andonValid
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
andPaymentMethodForm
) - Fixed issue with
payment
andpaymentMethod
props not updating on rerender - Added docstrings to components and functions
- Delay
initalizePayload
untilclientToken
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
What's Changed
- Upgrade node version to v20.17.0 by @jcar787 in #57
- Add new options
preventDefault
andpreventSubmit
to React library by @NathanYearout in #55
Full Changelog: v1.2.4...v1.2.5
v1.2.4
What's Changed
- Add type definitions for payload-react module. by @jcar787 in #47
- Add disablePaste attribute by @NathanYearout in #31
- Bump ejs from 3.1.9 to 3.1.10 in /examples/react-16 by @dependabot in #43
- Bump ejs from 3.1.9 to 3.1.10 in /examples/react-18 by @dependabot in #44
- Bump ws from 8.13.0 to 8.17.1 by @dependabot in #46
- Bump braces from 3.0.2 to 3.0.3 in /examples/react-18 by @dependabot in #48
New Contributors
- @NathanYearout made their first contribution in #31
Full Changelog: v1.2.3...v1.2.4
v1.2.3
v1.2.2
What's Changed
Full Changelog: v1.2.1...v1.2.2
v1.2.1
v1.2.0
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
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
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
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