Fragment
<Fragment>, commonly used via the <>...</> syntax, allows grouping elements without introducing a wrapper node. In most cases, the empty JSX tag <></> is a shorthand for <Fragment></Fragment>.
function Post() {
return (
<>
<PostTitle />
<PostBody />
</>
);
}Profiler
<Profiler> enables programmatic measurement of the rendering performance of a React tree.
<App>
<Profiler id="Sidebar" onRender={onRender}>
<Sidebar />
</Profiler>
<PageContent />
</App>StrictMode
<StrictMode> helps identify common errors in components during development. It is not a rendered component but a tool for detecting potential issues. It does not produce visible UI, but in development mode, it performs additional checks on wrapped components, such as detecting deprecated lifecycle methods or incorrect state updates in functional components.
import React from 'react';
function App() {
return (
<React.StrictMode>
<MyComponent />
</React.StrictMode>
);
}MyComponent will be subject to StrictMode checks.
Suspense
<Suspense> displays a fallback until its children finish loading. One of React 18’s most notable features, Suspense allows showing a loading indicator while waiting for asynchronous data and gracefully handles errors. It wraps components that may load asynchronously, such as data-fetching or dynamically imported components.
import React, { lazy, Suspense } from 'react';
const LazyComponent = lazy(() => import('./LazyComponent'));
function App() {
return (
<div>
<h1>Loading Example</h1>
<Suspense fallback={<div>Loading...</div>}>
<LazyComponent />
</Suspense>
</div>
);
}LazyComponent is dynamically imported using the lazy function. While LazyComponent loads, Suspense displays a “Loading…” placeholder.
ErrorBoundary
ErrorBoundary is a React component that catches JavaScript errors anywhere in its child component tree, preventing the entire application from crashing. When an error is caught, it renders a fallback UI until the issue is resolved.
import React from 'react';
class ErrorBoundary extends React.Component {
constructor(props) {
super(props);
this.state = { hasError: false };
}
static getDerivedStateFromError(error) {
return { hasError: true };
}
componentDidCatch(error, errorInfo) {
console.error('Uncaught error:', error, errorInfo);
}
render() {
if (this.state.hasError) {
return <h1>Something went wrong.</h1>;
}
return this.props.children;
}
}
function App() {
return (
<ErrorBoundary>
<MyComponent />
</ErrorBoundary>
);
}Concurrent Mode
While not a component itself, Concurrent Mode impacts React’s internal workings, enabling more efficient handling of complex UI updates. It introduces new APIs and components like startTransition and useTransition, along with enhancements to Suspense, to support concurrent rendering.
useTransition
useTransition is a Hook that allows controlling when React starts potentially expensive UI updates, preventing UI blocking.
import React, { useTransition } from 'react';
function App() {
const [isPending, startTransition] = useTransition();
function handleClick() {
startTransition(() => {
// Code here executes during the transition phase
// Update state or perform operations that may trigger re-renders
});
}
return (
<div>
<button onClick={handleClick}>Start Transition</button>
{isPending && <div>Loading...</div>}
</div>
);
}



