Skip to content

Commit dbc7a32

Browse files
justin808claude
andcommitted
Fix client-side HelmetProvider requirement for @dr.pogodin/react-helmet
Add HelmetProvider wrapper to client-side entry points for ReactHelmet components. The @dr.pogodin/react-helmet package requires HelmetProvider to wrap all Helmet components, on both server and client sides. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent db1c0fd commit dbc7a32

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

react_on_rails/spec/dummy/client/app/startup/ReactHelmetApp.client.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
// Top level component for simple client side only rendering
22
import React from 'react';
3+
import { HelmetProvider } from '@dr.pogodin/react-helmet';
34
import ReactHelmet from '../components/ReactHelmet';
45

56
// This works fine, React functional component:
67
// export default (props) => <ReactHelmet {...props} />;
78

8-
export default (props) => <ReactHelmet {...props} />;
9+
// HelmetProvider is required by @dr.pogodin/react-helmet for both client and server rendering
10+
export default (props) => (
11+
<HelmetProvider>
12+
<ReactHelmet {...props} />
13+
</HelmetProvider>
14+
);
915

1016
// Note, the server side has to be a Render-Function
1117

react_on_rails/spec/dummy/client/app/startup/ReactHelmetAppBroken.client.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
// Top level component for simple client side only rendering
22
import React from 'react';
3+
import { HelmetProvider } from '@dr.pogodin/react-helmet';
34
import ReactHelmet from '../components/ReactHelmet';
45

56
// This works fine, React functional component:
67
// export default (props) => <ReactHelmet {...props} />;
78

8-
export default (props) => <ReactHelmet {...props} />;
9+
// HelmetProvider is required by @dr.pogodin/react-helmet for both client and server rendering
10+
export default (props) => (
11+
<HelmetProvider>
12+
<ReactHelmet {...props} />
13+
</HelmetProvider>
14+
);
915

1016
// Note, the server side has to be a Render-Function
1117

0 commit comments

Comments
 (0)