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

exposes all types #1586

Merged
merged 2 commits into from
Nov 21, 2023
Merged

Conversation

kotarella1110
Copy link
Contributor

@kotarella1110 kotarella1110 commented Nov 21, 2023

Summary

This PR exposes all types of React on Rails. There are two main reasons for this:

Firstly, I frequently use types such as RenderFunction and RailsContext and would like to import them with minimal code:

- import { RenderFunction, RailsContext } from "react-on-rails/node_package/lib/types";
+ import { RenderFunction, RailsContext } from "react-on-rails";

Additionally, since railsContext is customizable, exposing the RailsContext type allows for extensions like the following:

react-on-rails.d.ts:

declare module "react-on-rails" {
  interface RailsContext {
    key1: string;
    key2: string;
  }
}

export {};

スクリーンショット 2023-11-21 18 34 17

Pull Request checklist

Remove this line after checking all the items here. If the item is not applicable to the PR, both check it out and wrap it by ~.

  • Add/update test to cover these changes
  • Update documentation
  • Update CHANGELOG file
    Add the CHANGELOG entry at the top of the file.

Other Information

Remove this paragraph and mention any other important and relevant information such as benchmarks.


This change is Reviewable

@ahangarha ahangarha requested a review from Judahmeek November 21, 2023 10:55
@Judahmeek Judahmeek force-pushed the feat/expose-all-types branch from 21490a8 to 474e5c8 Compare November 21, 2023 19:06
@Judahmeek Judahmeek merged commit 8198355 into shakacode:master Nov 21, 2023
19 checks passed
@kotarella1110
Copy link
Contributor Author

@Judahmeek Is the release of 13.4.1 still pending? I'm eagerly looking forward to it 😁

@ahangarha
Copy link
Contributor

@kotarella1110 The changes are released in v14.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants