Eui: [META][DOCS] Convert examples to function components + hooks

Created on 23 Mar 2020  路  10Comments  路  Source: elastic/eui

We've embraced function components and hooks in our src, but continue to copy&paste the examples' class component structure when creating new docs. This also impacts developers when they go to copy the example code, and need to convert it from class components.

New examples should avoid using class components, and existing ones should be converted.

chore documentation meta

All 10 comments

Thoughts on converting them to TS as well? (There have been a few times that I go to copy and paste and example only for it to have type errors which is kind of annoying...)

@myasonik https://github.com/elastic/eui/issues/1799 discusses this a bit. I think preferably we'd have both.

Can I work on this?

Yes. Though I'd recommend doing one page at a time to make the reviews easier to track.

@mridulgogia Are you working on it?

@Marvin9 yes

@mridulgogia & @Marvin9 There a lots of files that will need to be converted. I'm sure there's a way for multiple people to work on this without duplicating the work.

@cchaos agreed.

@mridulgogia I will start in reverse order.

I am done with most of the files and as you have asked to PRs a file one at a time

Maybe a light grouping of files instead of one at a time then? Haha

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sebastienlabine picture sebastienlabine  路  3Comments

flash1293 picture flash1293  路  3Comments

cahna picture cahna  路  3Comments

miukimiu picture miukimiu  路  3Comments

johnbarrierwilson picture johnbarrierwilson  路  3Comments