Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Document method to call on refs #419

Open
@cem2ran

Description

@cem2ran

Bringing this over from Discord as requested by@MoOx. I'm basically not sure if this is the right way to use refs and if the external I've defined in the following example should be exposed in the repo:

openReactNative;openReactNavigation;// TODO: add to TextInput?externalelementToObj:TextInput.element =>Js.t({..})="%identity";[@react.component]letmake= (~navigation:Navigation.t)=> {openNavigation;let (text,onChangeText)=React.useState(()=>"Home");letref=React.useRef(Js.Nullable.null);React.useEffect0(()=> {letintervalId=Js.Global.setTimeout(()=>switch (ref->React.Ref.current->Js.Nullable.toOption) {|Some(_ref)=> _ref->elementToObj##focus()|None=>()          },5000,      );Some(()=>Js.Global.clearTimeout(intervalId));  });  <>    <TouchableOpacity      onPress={_=> navigation->Navigation.navigate("PrivacyPolicy")}>      <Text> {React.string(text)} </Text>    </TouchableOpacity>    <TextInput ref onChangeText={text=> onChangeText(_=> text)} />  </>;};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp