I am trying to create a React-Router series to navigate within a specific component. I configured it so that the link tags work correctly, but I'm trying to configure them like this:

Styling is configured as follows:
<div className="btn-group" data-toggle="buttons"> <label className="btn btn-primary-outline active"> <input type="radio" name="options" id="option1" autocomplete="off" checked />Payments </label> <label className="btn btn-primary-outline"> <input type="radio" name="options" id="option2" autocomplete="off" /> Bills </label> <label className="btn btn-primary-outline"> <input type="radio" name="options" id="option3" autocomplete="off" /> Charge </label> </div>
And the current series of links looks like this (without styling):
<ul> <Link to='/options/option1'>option1</Link> <Link to='/options/option2'>option2</Link> <Link to='/options/option3'>option3</Link> </ul>
HTML (above) is written in HTML, not JSX, but that is not a problem. I am trying to combine the Linking Components in the HTML above so that the parameters activate link tag functionality.
In the React documentation, I found this:
For communication between two components that do not have a parent-child relationship, you can configure your own global event system. Subscribe to events in componentDidMount (), unsubscribe from componentWillUnmount () and call setState () when you receive the event. A flow pattern is one of the possible ways to organize it.
So, it gave me the idea to put Link tags inside their respective labels, giving them the style {{display: 'none'}}, and by clicking on the radio buttons, click on the corresponding link tag. This will ensure that all the same functions that we expect from the Link tag are performed (clicking on the browser history, etc.).
However, the following does not work:
<label className="btn btn-primary-outline active" onClick={() => document.getElementById('linkToOption1').click() }> <Link to='/options/option1' id="linkToOption1" style={{display: 'none'}}>Option1</Link> <input type="radio" name="options" id="option1" autoComplete="off" defaultChecked />Option1 </label>
In the previous example, you can see that I created an onClick event handler that selects the Link tag id and triggers a click.