Fork me on GitHub
#re-frame
<
2017-12-15
>
ilevd09:12:25

How can I re-render a component despite same props?

ilevd09:12:22

This component will be modified manually on component-did-mount

ilevd09:12:26

I need to re-render (re-create) it because it's iframe and I want to delete some variables/listeners etc in it

joelsanchez10:12:48

re-render is not re-create, at least to me: on a form-2 component, re-creating would execute the outer body, re-rendering wouldn't

joelsanchez10:12:41

since you don't want to change the props (although you could simply pass a counter and increment it when you want to rerender), you can dereference a ratom for the only purpose of rerendering

ilevd10:12:27

It seems it applies only differences from prev/next dom trees, but not re-render the whole component

mccraigmccraig11:12:01

@ilevd you can also give the component a :key and change the :key - react will treat it as a new component

ilevd14:12:29

@mccraigmccraig thank you, it's what I need

jonr23:12:14

can anyone point me to some up to date information around dynamic subs? I found this https://github.com/Day8/re-frame/wiki/Dynamic-Subscriptions but can’t find what the most recent approach is