Closed romain-trotard closed 2 weeks ago
Oof yea this was contributed and is my fault for merging in a sloppy state.
Happy to accept the PR, and your suggestions sound right.
Just pushed a simple fix for now. Actually looking at it its fine to keep as-is.
Hello :)
Current Behavior
Currently, we can change the package manager (thanks to tabs) to have the right command to execute.
It changes the selected package manager for every code block, but the command does not change for other code block.
Expected Behavior
The command should changed in function of the selected package manager for all code blocks.
The reason is that there is a local state for the command in the getBashCommand file. I think this state should be removed, because the source of truth should be the selected tabs (which is stored on the local storage) and the command, in my opinion, should be calculated on the render.
I have made a commit on a fork https://github.com/romain-trotard/tamagui/commit/5503296d9721d09266c032a69f0618c5006984e4. I will be very pleased to open a PR :)
ps: I think it's possible to do another solution: state up every state of the
RowingTabs
components in a hook (getBashCommand would be transformed into a hook), and use it in theDocCodeBlock
component. But, I think there are some drawbacks like extracting the logic of theRowingTabs
. The positive point would be that theuseEffect
I added would be removed.Tamagui Version
Platform (Web, iOS, Android)
Reproduction
System Info
No response