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

[object Object] when rendering TextInput with Text inside #519

Open
jcubic opened this issue Dec 7, 2023 · 0 comments
Open

[object Object] when rendering TextInput with Text inside #519

jcubic opened this issue Dec 7, 2023 · 0 comments

Comments

@jcubic
Copy link

jcubic commented Dec 7, 2023

Summary

If you attempt to create a rich text editor as written in docs Snack renders [object Object]

What platform(s) does this occur on?

Web

SDK Version

version online

Reproducible demo or steps to reproduce from a blank project

https://snack.expo.dev/@jcubic777/textarea

Przechwycenie obrazu ekranu_2023-12-07_23-24-17

Another issue is if you change the wrapper element from Text to View the snack doesn't show any error. But the app should throw an error because TextInput can't accept components different than Text.

  return (
    <TextInput
      style={[styles.texarea, style]}
      multiline
      onChange={changeHandler}>
      <View>
        {value.split('\n').map((line, index) => {
          const style = line.match(/^#/) && styles.header;
          return <Text style={style} key={`${index}-${line}`}>{ line }</Text>;
        })}
      </View>
    </TextInput>
  );

This should throw an error the same as react native.

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

No branches or pull requests

1 participant