Welcome to the forum!
It’s hard to help you without knowing the complete context. Mind you sharing your code into a working CodeSandbox so we can inspect it?
What’s important in the end is that your custom entries have a proper action
attribute that are handling the replacement.