Why not create a Context outside and import the in the App.js so that the child with useParams can consume the states