Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation for adding Ionic to an existing reactjs project #4051

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
17 changes: 17 additions & 0 deletions docs/intro/cdn.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ $ npm install @ionic/react-router
To include the necessary CSS in a React project, add the following to the root App component.

```javascript
/* Import setup Ionic react and IonApp for vite to recognize Ionic */
import { IonApp, setupIonicReact } from "@ionic/react";

/* Core CSS required for Ionic components to work properly */
import '@ionic/react/css/core.css';

Expand All @@ -78,6 +81,20 @@ import '@ionic/react/css/text-alignment.css';
import '@ionic/react/css/text-transformation.css';
import '@ionic/react/css/flex-utils.css';
import '@ionic/react/css/display.css';

/* Set up function */
setupIonicReact();

/* React App component */
export default const App = () = {

return(
<IonApp>
/* Components or routes go in here */
</IonApp>
)

}
```

## Ionic + Vue
Expand Down