← React Intermediate Questions - Set 1 Q1

What are higher-order components (HOCs) in React?

React Intermediate Questions - Set 1

Example

const withLoading = (C) => ({ loading, ...rest }) =>
  loading ? <Spinner /> : <C {...rest} />;

What to notice

← Back to the question list