Skip to content

Enabled property in useSimulateHook in wagmi 2 #4340

Answered by tmm
wahabshah21 asked this question in Q&A
Discussion options

You must be logged in to vote
function App() {
  const [enabled, setEnabled] = React.useState(false)
  const result = useSimulateContract({
    abi,
    address: '0x6b175474e89094c44da98b954eedeac495271d0f',
    functionName: 'transferFrom',
    args: [
      '0xd2135CfB216b74109775236E36d4b433F1DF507B',
      '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
      123n,
    ],
    query: {
      enabled,
    },
  })
}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@wahabshah21
Comment options

@tmm
Comment options

Answer selected by wahabshah21
@wahabshah21
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants