Add dynamic height to a Coinflow UI component
React
Response Example
Add a React component for your purchase form
I’ll call this one
Something went wrong!
. It was be any react component.
Import the wallet object
This will be passed to Coinflow later on
Create a height state variable
You can set this to anything initially. I’m using 0 to start.
Create the handler function
As another state variable, initialize the function that will change the Coinflow UI height.
Set function on mount
Copy this code to set the handleHeightChange function. This will render the Coinflow UI.
Add the Coinflow UI Component
In this case, I’ll use
Something went wrong!
, but you can use any other Coinflow UI component.
Pass in your handleHeightChange function
Add your function to the
Something went wrong!
component
Set up a dynamic height wrapper
Use a style object to configure dynamic height using your state variable height

