mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-14 21:07:33 -05:00
11 lines
192 B
JavaScript
11 lines
192 B
JavaScript
import { navigate } from 'gatsby';
|
|
|
|
const createRedirect = (to = '/') => () => {
|
|
if (typeof window !== 'undefined') {
|
|
navigate(to);
|
|
}
|
|
return null;
|
|
};
|
|
|
|
export default createRedirect;
|