How to approach feature flags, two concepts I'm contemplating

So the idea is that we have one data flow and we're replacing it with another. So the logic will be moved to backend and hence some interfaces will change. We need to support both approaches for a couple of months, so we added feature flags.

But how to implement them is the challenge here.

First idea is to add them inside components and "if" only the business logic. The ui (jsx and css) won't change. Once we've finished the new flow we can remove the code within components.

The other approach is to duplicate the whole component, rename it to something like OldComponentName and then just do an if in the wrapper component and return either old or new component. This would make it easier to remove the dead code (more or less just remove OldComponents). We don't expect that the existing code will change much or at all so no issues with maintenance.

Which approach seems better/ easier to handle this transition period?