Results for “prop”
Small, practical examples. Search by task or narrow things down below.
Give an optional property a default
Handle missing object fields with nullish coalescing.
optional✓ Tested
Inspect a URI through typed properties
PowerShell: The Uri class separates URL components without manual string splitting.
PowerShell✓ Tested
Load a small properties configuration
Java: Use a Reader to make the configuration character encoding explicit.
Java✓ Tested
Memoize a component with stable props
Memoize a component with stable props with a small React component and explicit browser behavior.
React✓ Tested
Notify a parent with a callback prop
Notify a parent with a callback prop with a small React component and explicit browser behavior.
React✓ Tested
Pass an input ref as a React 19 prop
Pass an input ref as a React 19 prop with a small React component and explicit browser behavior.
React✓ Tested
Pass an object to the style prop
Pass an object to the style prop with a small React component and explicit browser behavior.
React✓ Tested
Pass data through props
Pass data through props with a small React component and explicit browser behavior.
React✓ Tested
Prevent runtime changes to top-level properties
JavaScript: Object.freeze prevents ordinary top-level mutations; Reflect.set reports the rejected update without throwing.
JavaScript✓ Tested
Prevent runtime changes to top-level properties
TypeScript: Object.freeze prevents ordinary top-level mutations; Reflect.set reports the rejected update without throwing.
TypeScript✓ Tested
Propagate a parsing error with question mark
Propagate a parsing error with question mark in a complete Rust program using the standard library.
Rust✓ Tested
Provide a fallback for an unset custom property
CSS: The second var argument supplies a value when the custom property is unavailable.
CSS✓ Tested