Skip to content

Commit

Permalink
fix: KeyboardToolbar view props inheritance (#608)
Browse files Browse the repository at this point in the history
## 📜 Description

Minor tweaks to `KeyboardToolbar` view props inheritance coming from
this PR
#603

## 💡 Motivation and Context

I wanted to unify documentation style.

On JS side we should do spreading first, because otherwise unspecified
props can overwrite our props and it may lead to unpredictable behavior.

## 📢 Changelog

<!-- High level overview of important changes -->
<!-- For example: fixed status bar manipulation; added new types
declarations; -->
<!-- If your changes don't affect one of platform/language below - then
remove this platform/language -->

### JS

- spread `rest` before specifying other props (because in props
declaration we omit props that we use);

### Docs

- unify props inheritance style across documentation style.

## 🤔 How Has This Been Tested?

Tested manually on localhost:3000.

## 📸 Screenshots (if appropriate):

<img width="1423" alt="image"
src="https://github.com/user-attachments/assets/4cb3f44c-129b-43e1-a0bf-eeeac7568491">

## 📝 Checklist

- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changed
  • Loading branch information
kirillzyusko authored Sep 30, 2024
1 parent 92d6cee commit 5bc2cea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion docs/docs/api/components/keyboard-toolbar/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ import toolbar from "./toolbar.lottie.json";

## Props

Inherits [all props from the react-native View component](https://reactnative.dev/docs/view#props).
### [`View Props`](https://reactnative.dev/docs/view#props)

Inherits [View Props](https://reactnative.dev/docs/view#props).

### `button`

Expand Down
2 changes: 1 addition & 1 deletion src/components/KeyboardToolbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const KeyboardToolbar: React.FC<KeyboardToolbarProps> = ({

return (
<KeyboardStickyView offset={offset}>
<View style={toolbarStyle} testID={TEST_ID_KEYBOARD_TOOLBAR} {...rest}>
<View {...rest} style={toolbarStyle} testID={TEST_ID_KEYBOARD_TOOLBAR}>
{blur}
{showArrows && (
<>
Expand Down

0 comments on commit 5bc2cea

Please sign in to comment.