webscopeio / react-textarea-autocomplete

📝 React component implements configurable GitHub's like textarea autocomplete.
MIT License
454 stars 80 forks source link

Allow custom props to be passed alongside custom text area component #206

Open xchau opened 4 years ago

xchau commented 4 years ago

I am using my own "textarea" component that does some text manipulations under the hood, like so:

const CustomTextArea= React.forwardRef((props, ref) => { // Prop-dependent logic here }

However, my issue is that CustomTextArea's custom logic is dependent on an upstream node's props. Is there a way for me to pass down that upstream node's props? I'm imagining something like:

<ReactTextareaAutocomplete
    ...
    textAreaComponent={{ component: CustomTextArea, props: // Custom props here }}
    ...
/>
jukben commented 4 years ago

Hey this is unfortunately not possible. I recommend to make fork with this feature. Another way is to use patch-package. https://github.com/ds300/patch-package