ink-multi-select
ink-multi-select copied to clipboard
ink v3 compatibility
This wonderful ink component is not compatible with ink v3.
Currently, it throws the following error:
Error: Uncaught [TypeError: Cannot read property 'Consumer' of undefined]
The offending lines for this error are:
<StdinContext.Consumer>
{({stdin, setRawMode}) => (
// snip
)}
</StdinContext.Consumer>
within the MultiSelectWithStdin component.
According to the Ink v2 to v3 Migration Guide, StdinContext is removed in ink v3 (in favor or hooks).
I cannot speak for all the code in this project, but it seems as though this issue could be mitigated with something like:
import {useStdin} from 'ink';
// snip
export const MultiSelectWithStdin = props => {
const {stdin, setRawMode} = useStdin();
return <MultiSelect {...props} stdin={stdin} setRawMode={setRawMode}/>;
}
export default MultiSelectWithStdin;
although such a change would break ink v2 support...
I am willing to make a PR if the desire is to move forward with v3 compatibility, but I would first need to better understand to goals and desires of this project :nerd_face:
Either way, thanks for the great work up to this point!
Hey! I haven't worked on this in a while. I'll take some time in the next few weeks to rewrite it for Ink v3 and see what the best plan for it is moving forward 😄
@karaggeorge any thoughts on this so far?
Created an MR: #8
close this issue as fixed in https://github.com/karaggeorge/ink-multi-select/pull/8