Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions docs/macros.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ image::./factbox-macro.png[width=1028]

Make an interface for RestProps so you can use it in other components as needed:

.src/components/RestProps.tsx
.src/components/RestProps.d.ts
[source,TypeScript]
----
export interface RestProps {
Expand All @@ -102,10 +102,6 @@ import { RestProps } from './RestProps';
personID="paramValue"
...
/>

interface RestProps {
personID: string;
}
----

Import the interface and supply it to the Link.tsx, Image.tsx and Maxro.tsx components to make them aware of the new personID field:
Expand Down
12 changes: 10 additions & 2 deletions docs/react-app.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ With the sandbox running, open a new terminal tab/window and run the following c

[source,Terminal]
----
npm create vite@6.1.1 react-enonic -- --template react-ts
npm create vite@8.2.0 react-enonic -- --template react-ts
----

This will create a React app and place it in a folder called `react-enonic/`.
Expand All @@ -24,7 +24,7 @@ With the basic project files in place, you must add some handy npm modules as we
----
cd react-enonic

npm install --save react-router-dom sass @enonic/react-components@5.0.1 @enonic/js-utils
npm install --save react-router-dom sass @enonic/react-components @enonic/js-utils
----

== Configure
Expand Down Expand Up @@ -64,6 +64,14 @@ image::react-app.png[width=75%]
Although beautiful, the app doesn't do much yet and just shows the Vite+React splash screen.
Let's begin by adding a router and some custom styling:

. First, set the contents of `index.css` file to the following:
+
.index.css
[source,css]
----
include::{sourcedir}src/index.css[]
----
+
. Add a file called `App.sass` to the `/src` folder. We'll use it instead of the built-in `App.css`.
+
.src/App.sass
Expand Down
Loading