Destroy the instance and recreate one
Closed this issue · 2 comments
ciaoben commented
I am coding a wrapper of this great library for React. I was wondering if there is a way to destroy an instance and re-initialize it with new settings. (I saw reset, but it reset it to the original. I need to make a new one with different options)
Mobius1 commented
You can pass your new settings to the render()
method after destroying.
// instantiate
const instance = new Selectr("#mySelect", oldConfig);
// destroy
instance.destroy()
// render with new config
instance.render(newConfig)