hyochan / dooboo-ui-legacy

React Native UI Components with react-hook (web, ios, android)
MIT License
140 stars 72 forks source link

Split codes to remove circluar import #357

Closed JongtaekChoi closed 3 years ago

JongtaekChoi commented 3 years ago

Description

For removing the circular import, I moved types and GroupCheckboxContext to other files.

Checklist

Before you create this PR confirms that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

codecov[bot] commented 3 years ago

Codecov Report

Merging #357 into master will decrease coverage by 0.03%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #357      +/-   ##
==========================================
- Coverage   77.16%   77.12%   -0.04%     
==========================================
  Files          37       38       +1     
  Lines        1226     1224       -2     
  Branches      372      372              
==========================================
- Hits          946      944       -2     
  Misses        167      167              
  Partials      113      113              
hyochan commented 3 years ago

@JongtaekChoi How does this remove circular import?

JongtaekChoi commented 3 years ago

@hyochan
In the previous commit, GroupCheckboxContext was imported from CheckBox.tsx file, and CheckBox Component was imported from CheckBoxGroup.tsx File, so circular import occurred. I moved GroupCheckboxContext into a new file (GroupCheckboxContext.ts) and set to import it from CheckBox.tsx and CheckBoxGroup.tsx files respectively. And because the context required some types in CheckboxGroup.tsx file so I moved them to another new file(types.tsx) to avoid circular import.