is reusable good for 200lines of code in reactjs

So I m going to have 3 different component with different Imgs for each component and texts too like ( different for each titles or names) So I was wondering i can do like Fetch from Mongodb and use useNavigate to pass with state value like this
js
const navigation= useNavigate ();
navigation (`${val.name}` , { state : val })
js
const navigation= useNavigate ();
navigation (`${val.name}` , { state : val })
Here val is the data fetch from backend , so I'm using val.name as routes so it will be different routes For ex , if I click two it will navigate to /two and if I click one , it will nav to /one and pass different values for different routes And I use useLocation to get the values from that So my Question is All the components have same design but different Imgs and texts Would u guys think having 200+ lines of code as reusable component Or should I try useContext or should I go with useNavigate and useLocation ??
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server