Thanks in advance for any help.
I am developing a web application that uses Reactjs and material-UI to display energy use data for multiple farms.
I wish to click a button on the main page and that takes me to another page for an individual farm to view its data.
Here is the code, which uses the NavLink component to redirect the page:
{/*Farm B*/}
<GridItem xs={12} sm={6} md={3}>
<Card>
<CardHeader
color="danger"
stats
icon
sensorValue="43.27"
cardName="Farm B"
>
<CardIcon color="primary">
<SvgIcon
component={BarnIcon}
viewBox="0 0 980.000000 980.000000"
/>
</CardIcon>
</CardHeader>
<CardFooter stats>
**<NavLink to="/admin/dashboard" activeClassName="selected">**
GO
</NavLink>
</CardFooter>
</Card>
</GridItem>
From here, when it lands on the requested page i.e., for farm B, how do I send a string as a variable to the second page so that instead of having X number of individual pages for individual farms, I can simply specify a variable - say 'A' or 'B' etc and it loads the same page with dynamic data.
Thanks.
/admin/dashboard?/admin/dashboard/A/) is your decision.