preactjs / signals

Manage state with style in every framework
https://preactjs.com/blog/introducing-signals/
MIT License
3.71k stars 91 forks source link

docs: add React fragment note #385

Closed christowiz closed 1 year ago

christowiz commented 1 year ago

There is missing documentation regarding the TypeScript error in React when the signal object is used directly in JSX. This requires wrapping the object in a React Fragment (see https://github.com/preactjs/signals/issues/323).

This PR adds a note about the React Fragment requirement. The Preact 'Render Optimization' content was copied with changes to code example and added note. This updated code sample was tested and working the correctly with React.

https://codesandbox.io/s/preact-signals-in-react-test-mzfv8x\?file\=/src/LogCount.tsx

changeset-bot[bot] commented 1 year ago

⚠️ No Changeset found

Latest commit: e6275a689d6036e22bfdf01bb21805bf564d980a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

netlify[bot] commented 1 year ago

Deploy Preview for preact-signals-demo ready!

Name Link
Latest commit e6275a689d6036e22bfdf01bb21805bf564d980a
Latest deploy log https://app.netlify.com/sites/preact-signals-demo/deploys/64ac57fb8a739300088910c0
Deploy Preview https://deploy-preview-385--preact-signals-demo.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.