How to use the informed.withFieldState function in informed

To help you get started, we’ve selected a few informed examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LN-Zap / zap-desktop / renderer / components / Home / DeleteWalletDialog.js View on Github external
const DialogWrapper = ({ intl, isOpen, walletDir, onDelete, onCancel }) => {
  useCloseOnUnmount(isOpen, onCancel)

  if (!isOpen) {
    return null
  }
  const checkboxFieldName = 'actionACK'

  // bind button disabled state to a form field or ignore it if we are dealing with a remote
  // wallet and don't have confirmation checkbox
  const DeleteWalletButton = withFieldState(checkboxFieldName)(({ fieldState, ...rest }) => (
    <button>
  ))

  const buttons = (
    &lt;&gt;
      
        
      
      </button><button type="button">
        
      </button>
    
  )

  const header = (
github LN-Zap / zap-desktop / renderer / components / Channels / ChannelCloseDialog.js View on Github external
const DialogWrapper = ({ intl, isForceClose, isOpen, onClose, onCancel, csvDelay }) =&gt; {
  useCloseOnUnmount(isOpen, onCancel)

  if (!isOpen) {
    return null
  }
  const checkboxFieldName = 'actionACK'
  // bind button disabled state to a form field
  const CloseChannelButton = withFieldState(checkboxFieldName)(({ fieldState, ...rest }) =&gt; (
    <button>
  ))

  const buttons = (
    &lt;&gt;
      
        
      
      </button><button type="button">
        
      </button>
github LN-Zap / zap-desktop / renderer / components / Onboarding / Steps / components / SkipBackupsDialog.js View on Github external
const DialogWrapper = ({ intl, isOpen, isRestoreMode, onSkip, onCancel, position }) =&gt; {
  if (!isOpen) {
    return null
  }
  const checkboxFieldName = 'actionACK'

  const SkipButton = withFieldState(checkboxFieldName)(({ fieldState, ...rest }) =&gt; (
    <button>
  ))

  const buttons = (
    &lt;&gt;
      
        
      
      </button><button type="button">
        
      </button>
    
  )

  const header = (
github LN-Zap / zap-desktop / renderer / components / Autopay / AutopayStatus.js View on Github external
const AutopayStatus = ({ fieldState, ...rest }) =&gt; (
  
)

AutopayStatus.propTypes = {
  fieldState: PropTypes.object.isRequired,
}

export default compose(
  withFieldState('isEnabled'),
  injectIntl
)(AutopayStatus)

informed

A lightweight framework and utility for building powerful forms in React applications

MIT
Latest version published 10 days ago

Package Health Score

84 / 100
Full package analysis