last-rev-llc / contentful-ui-extensions

Useful UI Extensions we use at Last Rev for customer projects
Apache License 2.0
19 stars 3 forks source link

Add SDK context #73

Closed tavurth closed 3 years ago

tavurth commented 3 years ago

Adds and injectable SDK context to the extension tree.

Use looks like:

import { useContext } from 'react'
import { SDKContext } from '../../context'

function MyComponent() {
  const sdk = useContext(SDKContext);
  ...
}

Or alternately:

import { useSDK } from '../../context'

function MyComponent() {
  const sdk = useSDK();
  ...
}
sonarcloud[bot] commented 3 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication