basecamp / basecamp/trix

Deprecation of DefaultProps

Open
#1,155 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
20k
Forks
1.1k
Avg merge
3d 12h
Merged PRs (30d)
13

Description

Hi, First of all, really enjoying the current progress on the Trix editor.

I get a deprecation warning for the use of JavaScript DefaultProps being replaced by JavaScript default parameters:

```
Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
```

It looks like trix uses it here:

```
function _jsx(e, r, E, l) {
REACT_ELEMENT_TYPE || (REACT_ELEMENT_TYPE = "function" == typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103);
var o = e && e.defaultProps,
n = arguments.length - 3;
if (r || 0 === n || (r = {
children: void 0
}), 1 === n) r.children = l;else if (n > 1) {
for (var t = new Array(n), f = 0; f < n; f++) t[f] = arguments[f + 3];
r.children = t;
}
if (r && o) for (var i in o) void 0 === r[i] && (r[i] = o[i]);else r || (r = o || {});
return {
$$typeof: REACT_ELEMENT_TYPE,
type: e,
key: void 0 === E ? null : "" + E,
ref: null,
props: r,
_owner: null
};
}
```

Maybe this could be fixed with the next minor update?

Contributor guide

No contributing guide indexed for this repository

Research direction

The report identifies the generated _jsx function and the defaultProps deprecation warning, but no source file or test is named. Start by locating where this helper or the corresponding defaultProps usage comes from, then run the relevant JavaScript checks and confirm the warning no longer appears without changing the editor’s behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.