-
Notifications
You must be signed in to change notification settings - Fork 455
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
Added implementation instructions for features #286
Conversation
…hem up on fisrt feature
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/growthbook/docs/EBzExF2gh3G5ZEd8QFirGeU8wmpF [Deployment for 870fcc7 canceled] |
id: "react", | ||
display: "React", | ||
language: "tsx", | ||
boolean: `import { useFeature } from "@growthbook/growthbook-react"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to import IfFeatureEnabled component
value: `color := gb.Feature(${JSON.stringify( | ||
feature.id | ||
)}).GetValueWithDefault("blue") | ||
fmt.Println(color)`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be more generic instead of color? Might look weird if the feature has nothing to do with colors.
}`, | ||
value: `$color = $growthbook->getValue(${JSON.stringify( | ||
feature.id | ||
)}, "blue"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. More generic instead of using color.
<p> | ||
Read the{" "} | ||
<a href={o.docs} target="_blank" rel="noopener noreferrer"> | ||
{o.id} SDK docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this use display instead of id?
setFullSnippet(true); | ||
}} | ||
> | ||
full implementation guide |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling this a guide makes me think it will take me to a tutorial instead of just another code snippet. Maybe "full implementation example" instead?
@@ -41,6 +43,11 @@ export default function FeaturePage() { | |||
experiments: { [key: string]: ExperimentInterfaceStringDates }; | |||
}>(`/feature/${fid}`); | |||
|
|||
const { features } = useFeaturesList(); | |||
|
|||
const firstFeature = features?.length === 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a reliable way to do this. It's a race condition that will only work some of the time and worse may open the modal randomly on page load even if the person has many features already. Better to have the "create feature" modal add a query string when redirecting if it's the first feature.
Instructions automatically pop up on the first feature