mirror of
https://github.com/shoelace-style/shoelace.git
synced 2026-01-12 02:59:13 +00:00
remove side-effects key, update React docs for cherry-picking (#1485)
* remove side-effects, update React docs for cherry-picking * prettier * add PR # * prettier * fix react import paths * Update docs/pages/frameworks/react.md Co-authored-by: Cory LaViska <cory@abeautifulsite.net> * add colons to imports --------- Co-authored-by: Cory LaViska <cory@abeautifulsite.net>
This commit is contained in:
@@ -24,9 +24,12 @@ components.map(component => {
|
||||
const tagWithoutPrefix = component.tagName.replace(/^sl-/, '');
|
||||
const componentDir = path.join(reactDir, tagWithoutPrefix);
|
||||
const componentFile = path.join(componentDir, 'index.ts');
|
||||
const importPath = component.path;
|
||||
const importPath = component.path.replace(/\.js$/, '.component.js');
|
||||
const eventImports = (component.events || [])
|
||||
.map(event => `import { ${event.eventName} } from '../../../src/events/events';`)
|
||||
.map(event => `import type { ${event.eventName} } from '../../../src/events/events';`)
|
||||
.join('\n');
|
||||
const eventExports = (component.events || [])
|
||||
.map(event => `export type { ${event.eventName} } from '../../../src/events/events';`)
|
||||
.join('\n');
|
||||
const eventNameImport =
|
||||
(component.events || []).length > 0 ? `import { type EventName } from '@lit-labs/react';` : ``;
|
||||
@@ -46,6 +49,7 @@ components.map(component => {
|
||||
|
||||
${eventNameImport}
|
||||
${eventImports}
|
||||
${eventExports}
|
||||
|
||||
const tagName = '${component.tagName}'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user