If using the new style context, re-declare this in your class to be the
React.ContextType
of your static contextType
.
Should be used with type annotation or static contextType.
static contextType = MyContext
// For TS pre-3.7:
context!: React.ContextType<typeof MyContext>
// For TS 3.7 and above:
declare context: React.ContextType<typeof MyContext>
If set, this.context
will be set at runtime to the current value of the given Context.
Usage:
type MyContext = number
const Ctx = React.createContext<MyContext>(0)
class Foo extends React.Component {
static contextType = Ctx
context!: React.ContextType<typeof Ctx>
render () {
return <>My context's value: {this.context}</>;
}
}
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Listens for when cell border is selected and stores the index of the column and mouse start position
Updates the distance the user drags the table column divider
Listens for when user is done resizing the column, resets drag position stats
Check if the current table has blob attributes
Clears the staging once delete/update is successful and table content has been modified
Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.
Called immediately after a component is mounted. Setting state here will trigger re-rendering.
Reset the table action sub menu selection upon a new table selection
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
cancelled network requests, or cleaning up any DOM elements created in componentDidMount
.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Helper function to construct the ReactRef arrays for the number of tuples shown per page
an Array of RefObject for each of the entry in the table on the current page
Tells the element how to style width of the given table column index
Switching return code based this.state.currentSelectedTableActionMenu. Mainly used in the render() function below
Function to get the list of primary attributes for rendering
Function to get the list of secondary attributes for rendering
Warning that pops up to prevent user from staging multiple entries for delete/update
Runs before React applies the result of render
to the document, and
returns an object to be given to componentDidUpdate. Useful for saving
things such as scroll position before render
causes changes to it.
Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.
Handle button rednering with disable feature for Insert Update or Delete based on the table type and return the buttons accordingly
Call back function for goBackwardAPage button
Call back function for goForwardAPage button
Call back function for goToFirstPage button
Call back function for goToLastPage button
Call back for subcomponents to set loading animation
Function to stage the selected table entries for insert/update/delete process For insert, this will be used for the entry-copy-autofill feature requested. Datatype included in the selectedTableEntry but should we format datatype to DJ style here or right before making the API call?
Call back for when the user change the number of tupples to show per page
Value should be the number in string format
Function to handle the hiding/showing of the sub menus including dealing with switching between the table actions sub menu
The tableActionMenu that was clicked on
Function to set the new adjusted width (TODO: fix to make sure the fix is for each column using reference)
// the distance the user dragged the column divider handle
Called to determine whether the change in props and state should trigger a re-render.
Component
always returns true.
PureComponent
implements a shallow comparison on props and state and returns true if any
props or states have changed.
If false is returned, Component#render
, componentWillUpdate
and componentDidUpdate
will not be called.
Converts the current table action type to string for proper rendering on loading popup text
Generated using TypeDoc
Component to handle rendering of the tuples as well as Filter, Insert, Update, and Delete subcomponents