Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat rn keyboard avoiding #1730

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

WX-DongXing
Copy link
Collaborator

No description provided.

@@ -446,6 +446,8 @@ export function getDefaultOptions ({ type, rawOptions = {}, currentInject }) {
const { Provider, useSafeAreaInsets, GestureHandlerRootView } = global.__navigationHelper
const pageConfig = Object.assign({}, global.__mpxPageConfig, currentInject.pageConfig)
const Page = ({ navigation, route }) => {
const [enabled, setEnabled] = useState(false)
const keyboardAvoidContextValue = useRef({ setEnabled })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不需要创建这个ref直接把setEnabled作为contextValue传过去就可以,setEnabled每次渲染都指向同样的函数实例

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已调整

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants