Skip to content

Commit

Permalink
Update src/docs/tipsForReusableCode.mdx
Browse files Browse the repository at this point in the history
Co-authored-by: James Sheasby Thomas <[email protected]>
  • Loading branch information
kimon-satan and rightsaidjames authored Feb 28, 2024
1 parent 0621d19 commit ab3f718
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/docs/tipsForReusableCode.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ In all cases your component will be a function composed of other atoms, molecule

### Decomposition
- In the most complex cases you might want to decompose the existing component into smaller components. This will then allow you to recompose them, replacing only the parts you want to change.
- An example of this is `OakCheckBox` and `OakQuizCheckBox` which are ccomposed of `InternalCheckBox`,`InternalCheckBoxLabel` and `InternalCheckBoxWrapper` . This allows the `OakQuizCheckBox` to have a different layout and behaviour to the `OakCheckBox` but with the same underlying functionality.
- An example of this is `OakCheckBox` and `OakQuizCheckBox` which are composed of `InternalCheckBox`,`InternalCheckBoxLabel` and `InternalCheckBoxWrapper` . This allows the `OakQuizCheckBox` to have a different layout and behaviour to the `OakCheckBox`, but with the same underlying functionality.
- This is probably the most robust method but the most labour intensive as it involves refactoring the existing component.
- Some risks to look out for are:
- poor discoverability: make sure the decomposed components are named in relation to what they should compose. Follow [naming conventions](/docs/docs-namingconventions--docs)

0 comments on commit ab3f718

Please sign in to comment.