2

I'm maintaining React app and I have to turn all class components into functional.

One component has the renderChildren() method.

Is there a way to mimic that method in a functional component with hooks?

I really appreciate the support.

  • 1
    There's no official `renderChildren` method in React so we can't say exactly how to recreate since we don't know what yours does. But likely it just returns the JSX to be rendered. So just do that inside the return statement itself, or create a function in the body of the functional component that has the same behaviour – Jayce444 Dec 11 '20 at 00:02
  • 1
    Yeah. It looks like it is a function created by the previous developer. I appreciate your support! – Jose Maselli Dec 11 '20 at 00:21

0 Answers0