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

Use the text prop to set text in editor #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

reggie3
Copy link
Contributor

@reggie3 reggie3 commented Nov 14, 2020

The documentation says that the text prop is used to set the contents of the editor, but the current code expects to find that information in a PlaceHolder prop. This PR fixes the code to match the documentation.

The documentation says that the `text` prop is used to set the contents of the editor, but the current code expects to find that information in a `PlaceHolder` prop.  This PR fixes the code to match the documentation.
@eneskarpuz
Copy link
Owner

Hey @reggie3! thanks for your attention. It looks like just a Readme mistake. Text value of editor is setting in onText function with onChangeText prop of TextInput in DragTextEditor.js. Also in that part you mentioned PlaceHolder prop is setting the first value of text state with a condition.Tell me If I'm missing something you said ?

@reggie3
Copy link
Contributor Author

reggie3 commented Nov 15, 2020

It sounds like you're saying that if we want to provide text to the DragTextEditor component, then it needs to be provided via the PlaceHolder prop; Is that correct? If not, how should the text be provided?

@eneskarpuz
Copy link
Owner

Want to provide external text to the component other than text entered on the keyboard? If so. Yes, You can do that with the PlaceHolder prop. The prop name may vary but you should do this for all the PlaceHolder props.

@reggie3
Copy link
Contributor Author

reggie3 commented Nov 15, 2020

Okay, that makes sense. If that is the case, then I don't think this PR is necessary.

Copy link
Owner

@eneskarpuz eneskarpuz left a comment

Choose a reason for hiding this comment

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

@reggie3 If you want, it would be good to update the PlaceHolder prop to a expression that indicates it can get external values in readme and code. I think lib needs it.

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