vadimdemedes / pastel

🎨 Next.js-like framework for CLIs made with Ink
https://term.ink/pastel
MIT License
2.2k stars 36 forks source link

question: I want to learn use pastel with ink-table,can you give me some demo code... #42

Closed AaronConlon closed 1 year ago

AaronConlon commented 4 years ago

and thanks.I can not understand it.ink-table use render function,but pastel not. I try to export it,but a lot of error.

// data is valid array from demo code
const Basic = () => <Table data={data} />;
export default Basic;

but error:


  ERROR Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely  
       forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

       Check the render method of `Skeleton`.
AeonFr commented 3 years ago

I was successfully able to use ink-table alongside pastel. Looks like your error comes from the Skeleton component. Can you provide a more complete stack trace?

diego-carvallo commented 1 month ago

Hi I created a new project using npx create-pastel-app and I followed the sample here to use ink-table, so I have:

import Table from 'ink-table';

const data = [
  {
    name: 'Sosa Saunders',
    gender: 'male',
    age: 17,
  },
  {
    name: 'Angelina Kirk',
    gender: 'female',
    age: 33,
  }
]

export const alias = 'n';

export default function normalize() {
    return <Table data={data} />;
}

but I get this error when running npm build:

image

Please help! cc @AeonFr