IQSS / IQSS/dataverse-frontend

refactor: use context to share repository instances to avoid prop-drilling

Open
#878 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

FY26 Sprint 20 GREI Re-arch SPA SPA.Q1.2026.10
Dominant language
TypeScript
Stars
31
Forks
26
Avg merge
4d 13h
Merged PRs (30d)
4

Description

Overview of the Feature Request
In order to avoid prop-drilling, we could use context to share repository instances.

We could create a custom hook,useRepositories( ) for passing use cases, wrap everything inside its provider component. Storybook and Test files should also be modified to match the same pattern of use context.

There are some sample codes from German of making these changes in this branch -> https://github.com/IQSS/dataverse-frontend/compare/develop...avoid-prop-drilling

What kind of user is the feature intended for?
(Example users roles: API User, Curator, Depositor, Guest, Superuser, Sysadmin)
SPA developers

What inspired the request?
prop-drilling through multiple layers increase complexity of the code, so it is a way to optimize

What existing behavior do you want changed?
Whenever we need to pass repository props to component

Any brand-new behavior do you want to add to Dataverse?
Nothing related to current user-faced UI or behavior

Any open or closed issues related to this feature request?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing repository props and the sample changes in the linked avoid-prop-drilling branch. Trace the custom useRepositories hook and its provider through the affected components, then update the Storybook and test files mentioned in the issue. Done means repository instances are supplied through context without the existing prop-drilling, with those stories and tests using the same pattern.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.