XRPLF / xrpl-dev-portal

Source code for xrpl.org including developer documentation
https://xrpl.org
Other
512 stars 1k forks source link

Faucet UI cannot generate test credentials #2651

Closed justinr1234 closed 6 days ago

justinr1234 commented 1 week ago

The facuet ui is broken on http://xrpl.org https://xrpl.org/resources/dev-tools/xrp-faucets

Error: Minified React error #321; visit https://reactjs.org/docs/error-decoder.html?invariant=321 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at Object.gt (chunk-OTDIG2IN.js:7:19262)
    at r.useContext (chunk-PBDZ7PQF.js:1:5668)
    at Dt (chunk-OTDIG2IN.js:15:11322)
    at _ (xrp-faucets.page-3XXZMXAA.js:1:3742)
    at onClick (xrp-faucets.page-3XXZMXAA.js:1:4483)
    at Object.tE (chunk-OTDIG2IN.js:6:9858)
    at rE (chunk-OTDIG2IN.js:6:10012)
    at oE (chunk-OTDIG2IN.js:6:10069)
    at gh (chunk-OTDIG2IN.js:6:31464)
    at Bm (chunk-OTDIG2IN.js:6:31881)
justinr1234 commented 1 week ago

Calling a hook inside a callback on click function

https://github.com/XRPLF/xrpl-dev-portal/blob/0cf71fc46f5899ee7b0b1601a721546908649c4b/resources/dev-tools/xrp-faucets.page.tsx#L129

justinr1234 commented 1 week ago
  1. Make sure we add eslint rules to prevent this
  2. Make sure lint is run in CICD if it isn’t already
  3. Refactor this callback to not have hooks calls in it
  4. Probably just refactor this component into a book itself and have a callback function returned from the hook that can be called from the on click