How can I pass a variable into the attribute. I am using: https://polaris.shopify.com/components/actions/button
I currently have
const subscribeButton = (plan, text, type) => (
<div style={{textAlign: 'center', 'paddingBottom': 15}}>
<Button
onClick={() => processSubscription(plan.stripe_price_id)}
key={plan.stripe_plan_id}
-> Need to insert "type" here <-
>
<p>{text}</p>
</Button>
</div>
)
In my render, I have a few of these
subscribeButton(plan, 'Cancel', 'destructive')
I need pass the type of button, "primary", "destructive" and a few more options. I pass that in with the 3rd param. The issue is, this is a dynamic field such as
<Button primary></Button> and <Button destructive>.
How would I go about passing this in via a variable?