question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implementations with react-native

See original GitHub issue

Hi. I used this approach from other issues. But I got the next behavior:

  1. I received console.logs from my handlers
const handleOnChange = field => text => {
  console.log('%c handleOnChange', 'color: #0087d4', text);
  field.set(text);
};

they show me that input is reacted to typing but the value is not preserved. the whole component is next

import React from 'react';
import { TextInput } from 'react-native';

const handleOnChange = field => text => {
  console.log('%c handleOnChange', 'color: #0087d4', text);
  field.set(text);
};

const WrappedInput = props => {
  return (
    <TextInput
      {...props.field.bind({ onChange: () => {} })}
      onChangeText={handleOnChange(props.field)}
    />
  );
};

export default WrappedInput;

are there some examples using this lib with react-native?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
foxhound87commented, Mar 20, 2019

You definitely have to look bindings

You need to bind onChangeText to the built-in onChange handler:

<TextInput
      {...props.field.bind()}
      onChangeText={props.field.onChange}
/>
0reactions
foxhound87commented, Nov 14, 2021

Tested on react native and I had no issues. I close this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cross Platform Implementation - React Native
The React Native renderer utilizes a core render implementation to be shared across platforms​ ... In the previous render system of React Native, ......
Read more >
Implementation Notes - React
This section is a collection of implementation notes for the stack reconciler. ... Renderers like React DOM and React Native use it to...
Read more >
How to implement Redux in React Native apps - Enappd
Steps for Implementing Redux in React Native app · Step 1: Create a Basic React Native app · Step 2: Running app on...
Read more >
How to build a holistic tracking implementation with Analytics ...
We will start with a functional E-Commerce app built in React Native that does not have tracking implemented. From there, we will walk...
Read more >
React Native — Application architecture with Design pattern
Overview of app architecture features: This app will support all the major features required for a corporate application. It includes redux + ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found