Links Replacement not working

Hi,

I copied linkRewrite processor from github. But it won’t work on frontity site(http://localhost:3000) header menu links redirect to my wp site.

Here’s code

const linkRewrite = {
   name: 'linkRewrite',
   priority: 20,
   test: ({ node, component, props}) =>
      component === "a",
   processor: ({ node, state }) => {
      if (node.props.href.startsWith(state.frontity.url)) {
         node.props.href = node.props.href.replace(state.frontity.url, "/");
      }
      console.log(node);
      return node;
   }
}

export default linkRewrite;