How to use react_ujs - 10 common examples

To help you get started, we’ve selected a few react_ujs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github reactjs / react-rails / test / dummy_webpacker2 / app / javascript / packs / server_rendering.js View on Github external
// By default, this pack is loaded for server-side rendering.
// It must expose react_ujs as `ReactRailsUJS` and prepare a require context.
var componentRequireContext = require.context("components", true);
var ReactRailsUJS = require("react_ujs");
ReactRailsUJS.useContext(componentRequireContext);
github aarkerio / schnellentest / app / javascript / packs / application.js View on Github external
require("@rails/ujs").start();
require("turbolinks").start();
require("@rails/activestorage").start();
require("channels");


// Uncomment to copy all static images under ../images to the output folder and reference
// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
// or the `imagePath` JavaScript helper below.
//
// const images = require.context('../images', true)
// const imagePath = (name) => images(name, true)
// Support component names relative to this directory:
var componentRequireContext = require.context("components", true);
var ReactRailsUJS = require("react_ujs");
ReactRailsUJS.useContext(componentRequireContext);

import "bootstrap";
import "../../assets/stylesheets/application";

$(document).ready(function(){
  $('.header').height($(window).height());
});
github publiclab / plots2 / app / javascript / packs / application.js View on Github external
// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
// layout file, like app/views/layouts/application.html.erb


// Uncomment to copy all static images under ../images to the output folder and reference
// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
// or the `imagePath` JavaScript helper below.
//
// const images = require.context('../images', true)
// const imagePath = (name) => images(name, true)

console.log('Hello World from Webpacker')
// Support component names relative to this directory:
var componentRequireContext = require.context("components", true);
var ReactRailsUJS = require("react_ujs");
ReactRailsUJS.useContext(componentRequireContext);
github Terrastories / terrastories / rails / app / javascript / packs / application.js View on Github external
/* eslint no-console:0 */
// This file is automatically compiled by Webpack, along with any other files
// present in this directory. You're encouraged to place your actual application logic in
// a relevant structure within app/javascript and only use these pack files to reference
// that code so it'll be compiled.
//
// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
// layout file, like app/views/layouts/application.html.erb

const componentRequireContext = require.context("components", true);

const ReactRailsUJS = require("react_ujs");

ReactRailsUJS.useContext(componentRequireContext);
github spree / spree_starter / app / javascript / src / server_rendering.js View on Github external
// By default, this pack is loaded for server-side rendering.
// It must expose react_ujs as `ReactRailsUJS` and prepare a require context.
import ReactRailsUJS from 'react_ujs'
const componentRequireContext = require.context('providers', true)

ReactRailsUJS.useContext(componentRequireContext)
github Shopify / next-gen-auth-app-demo / app / javascript / packs / application.js View on Github external
require('@rails/ujs').start();
require('turbolinks').start();
require('@rails/activestorage').start();
require('channels');

// Uncomment to copy all static images under ../images to the output folder and reference
// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
// or the `imagePath` JavaScript helper below.
//
// const images = require.context('../images', true)
// const imagePath = (name) => images(name, true)
require('shopify_app');
// Support component names relative to this directory:
var componentRequireContext = require.context('components', true);
var ReactRailsUJS = require('react_ujs');
ReactRailsUJS.useContext(componentRequireContext);
github 8398a7 / abilitysheet / app / javascript / packs / react.ts View on Github external
// @ts-ignore
import ReactRailsUJS from 'react_ujs';
// @ts-ignore
const componentRequireContext = require.context('app', true);
ReactRailsUJS.useContext(componentRequireContext);
github reactjs / react-rails / lib / generators / templates / server_rendering_pack.js View on Github external
// By default, this pack is loaded for server-side rendering.
// It must expose react_ujs as `ReactRailsUJS` and prepare a require context.
var componentRequireContext = require.context("components", true);
var ReactRailsUJS = require("react_ujs");
ReactRailsUJS.useContext(componentRequireContext);
github bigbinary / wheel / app / javascript / packs / application.js View on Github external
/* eslint no-console:0 */
/* global require */
// This file is automatically compiled by Webpack, along with any other files
// present in this directory. You're encouraged to place your actual application logic in
// a relevant structure within app/javascript and only use these pack files to reference
// that code so it'll be compiled.
//
// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
// layout file, like app/views/layouts/application.html.erb

import "stylesheets/application";

// Support component names relative to this directory:
var componentRequireContext = require.context("src", true);
var ReactRailsUJS = require("react_ujs");
ReactRailsUJS.useContext(componentRequireContext);
github TheOdinProject / theodinproject / app / javascript / packs / application.js View on Github external
import '../src/js/bootstrapScripts';
import '../src/js/settings';
import '../src/js/navbar';
import '../src/js/admin_flash';
import '../src/js/odinDropDownMenu';
import '../src/js/scrollspy.min';

import 'controllers';

require('@rails/ujs').start();
require('turbolinks').start();

const componentRequireContext = require.context('components', true);
const ReactRailsUJS = require('react_ujs');

ReactRailsUJS.useContext(componentRequireContext);

react_ujs

Rails UJS for the react-rails gem

Apache-2.0
Latest version published 7 months ago

Package Health Score

88 / 100
Full package analysis

Popular react_ujs functions