so I need to store two unique ID’s into the url and extract the id’s in another component to get data from the data base.
This task requires me to send an email with a link to complete a task. If the task is deleted I need to know who sent the task email.
Any information of the direction I should move in is appreciated.
import React from 'react';
// current setup
const Practice = () => {
return (
<div>
<Router>
<Something path="/task/:id" />
<Something path="/task/:id/:action" />
</Router>
</div>
);
};
export default practice;
// desired setup
// I need to store Id's and make it not break the website. like lets say optional values or something.
// The only required value is the first /:id
const Practice = () => {
return (
<div>
<Router>
<Something path="/task/:id/:id?/:id?" />
</Router>
</div>
);
};
export default practice;
{ " desired output is = localhost:3000/task/111111?222222?33333" }
{ "so that I can store the last two id's in an array = "['localhost:3000/task/111111', '222222', '33333'] }
//component
const Task = ({ id, action, companyId, userId }) => {
const company = companyId
const user = userId
}