You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Created a new ink app, by using the create-ink-app tool, and installed the ink-text-input package. But am having issues with using this component.
I'm getting the following error, whenever I try to use the TextInput component:
ERROR Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
Check the render method of `InputBox`.
Example component:
constReact=require("react");const{ Box, Text }=require("ink");constTextInput=require("ink-text-input");constInputBox=({})=>{const[value,setValue]=React.useState("");return(<BoxflexDirection="column"><Box><Text>Value:</Text></Box><Box><TextInputvalue={value}onChange={setValue}/></Box></Box>);};module.exports={ InputBox };
The text was updated successfully, but these errors were encountered:
For the record, I had the same issue (and with ink-spinner too).
I solved it this way (even in TS)
importSpinnerCJSfrom'ink-spinner';importTextInputCJSfrom'ink-text-input';// @ts-expect-error -- issue with ink-text-input and CommonJS definitionconstTextInput=TextInputCJS.defaultastypeofTextInputCJS;// @ts-expect-error -- issue with ink-text-input and CommonJS definitionconstSpinner=SpinnerCJS.defaultastypeofSpinnerCJS;
Created a new ink app, by using the
create-ink-app
tool, and installed theink-text-input
package. But am having issues with using this component.I'm getting the following error, whenever I try to use the
TextInput
component:Example component:
The text was updated successfully, but these errors were encountered: