[Solved] Default components for Cell Loading,Error,Empty states

Now a cell has basic stuff for the Loading, Error, Empty components. What i want to do is create Custom components and apply them by default(overwriting the ones generated).

So the plan will be:

  1. Create custom components for Loading, Error, Empty;
  2. Provide them to some HOC;
  3. When i generate a cell use the custom components if they are provided in the HOC, else use the basic stuff generated.

This is important because if you have 100 cells. You will need to always add you custom stuff after creation(this is not the end of the world, but…).


Nice to meet you @bogdan2510

I think what you’re looking for are Redwood’s generators.

You can use the linked command to setup what will be templates that let you customize the code that’s generated each time you generate a “type” using yarn rw g [type]. You can setup one for cells, and each time you generate a cell it’ll use the template you provide, for example: to setup logging each time the <Failure> component is rendered.

This is exactly what i need. I skip some stuff when reading the docs(cli commands was one of them. :))

P.S: nice to meet you to @realStandal

1 Like