Skip to content

Instantly share code, notes, and snippets.

@tgalopin
Last active April 11, 2024 02:51
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tgalopin/f980149f95714293adee05cf11a85202 to your computer and use it in GitHub Desktop.
Save tgalopin/f980149f95714293adee05cf11a85202 to your computer and use it in GitHub Desktop.
// assets/controllers/app_controller.jsx
import React from 'react';
import { render } from 'react-dom';
import { Controller } from 'stimulus';
import App from '../components/App.jsx';
export default class extends Controller {
connect() {
render(<App />, this.element);
}
}
// In your Twig file:
// <div data-controller="app"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment