How to use the react-on-rails.render function in react-on-rails

To help you get started, we’ve selected a few react-on-rails 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 shakacode / react_on_rails / spec / dummy / client / app / components / HelloWorldRehydratable.jsx View on Github external
forceClientHydration() {
    const registeredComponentName = 'HelloWorldRehydratable';
    const { railsContext } = this.props;

    // Target all instances of the component in the DOM
    const match = document.querySelectorAll(`[id^=${registeredComponentName}-react-component-]`);
    // Not all browsers support forEach on NodeList so we go with a classic for-loop
    for (let i = 0; i < match.length; i += 1) {
      const component = match[i];
      // Get component specification 


react-on-rails JavaScript for react_on_rails Ruby gem

Latest version published 13 days ago

Package Health Score

92 / 100
Full package analysis